Eureka EngineeringLearn about Eureka’s engineering efforts, product developments and more.
![物理サーバを選定する際のポイント – Eureka Engineering – Medium](https://cdn-ak-scissors.b.st-hatena.com/image/square/96c17240e5e2d585a7b88afbfdb589268b9535b1/height=288;version=1;width=512/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1200%2F1%2A4nQvYibd3aHYOp1xrvmfMQ.png)
Eureka EngineeringLearn about Eureka’s engineering efforts, product developments and more.
最近マスタリングTCP/IP SSL/TLS編や暗号技術入門を読んでいた.理解を深めるためにGo言語で標準のcryptoパッケージを触り/実装を読みながら読んだ. cryptoパッケージは他の標準パッケージと同様に素晴らしい.Go言語にはどのような暗号化手法が実装されているのか実例を含めてざっとまとめる.なお本文に書ききれなかったものを含め全ての実装例はtcnksm/go-cryptoにある. 共通鍵暗号 まずは共通鍵暗号をみる.共通鍵暗号は暗号化と復号化に同じ鍵を用いる暗号化方式である.共通鍵暗号はブロック暗号とストリーム暗号の2種類に分けることができる.ブロック暗号は特定の長さ単位で暗号化を行う方式であり,ストリーム暗号はデータの流れを順次処理していく方式である. Go言語にはブロック暗号としてDES(Data Encryption Standard),DESを繰り返すtriple-D
golang が提供するインタフェースの中で代表的な物の使い方をまとめてみる。 io.Reader type Reader interface { Read(p []byte) (n int, err error) } ご存じ io.Reader。このシグネチャの Read を実装しておけば golang のありとあらゆる入力機能に対して自分のコードを提供する事が出来る。 例えば永遠に「おっぱい」と言い続ける Reader だと以下の様な実装になる。 package main import ( "io" "os" ) var text = []rune("おっぱい") type OppaiReader struct { n int } func (r *OppaiReader) Read(p []byte) (int, error) { in := len(p) nw := 0 for i
I'm trying to encrypt some text inside a database to be loaded and decrypted during program startup. I have tried a few methods, including a third party library https://github.com/richard-lyman/lithcrypt to no avail. Using the following method encrypts/decrypts 8/10 items, but it seems that some padding residue is left behind at some point in the encrypt/decrypt. As it stands my code is like this:
Idiomatic Go Tricks Go UK Conference - London, UK 18 August 2016 Mat Ryer matryer.com About me Using Go for six years (since before BETA) Author of Go Programming Blueprints Working at GrayMeta.com (100% Go backend) Wrote downlist.io, route.run, disclaimr.org - in Go running on App Engine Made BitBar app for Mac OS X - getbitbar.com another Go/AppEngine project Blog about Go on matryer.com 2 Idiom
Become part of a community passionate about building better apps. Golang: Run multiple services on one port Ever faced the problem of having multiple ports in an application, one for each service? In this post, I’m going to brief about how to run multiple services via the same listener port. At Dgraph , we used to have one port to serve HTTP requests, one for gRPC and one more for internal communi
Golangができること、むしろ「得意」と言われるものはすでにたくさんあります。 クロスコンパイルが得意だし依存が少ないバイナリができるから、いろんな環境で使えるコマンドラインツールを書くにはGoがいいよ パフォーマンスが高いし文字列処理もやりやすいので、高速なAPIサーバが得意。gRPCでもHTTP/2でも Webアプリケーション・フレームワークも増えてきていてウェブサービス作れるよ ビルドシステムとパッケージマネージャ内蔵なので、gitから簡単にパッケージをダウンロードしてきたり、◯makeコマンドとか◯runtとか◯owerで消耗しなくて済む gopher.jsでJavaScriptにもなる 逆に今まであまり良い解がなくて、「Goにはちょっと不向きだね」と言われ続けていたのがGUIです。鳴り物入りで出てきたGXUIが開発が止まってしまい、それと同じぐらいにshinyというものが開発が
GAE/J+Slim3の語彙・知識を元にここに解説を書く。 GAE/Goの知識とGo言語の知識が混ぜこぜで書かれているかあまり気にしてはいけない。 以下の調査結果を得るためのテストコードはここに置いた。 EntityにKeyは付属してこない structを定義する時に、そのstructに自分自身のKeyを持たせる方法はない。 EntityにIdまたはNameを自分で定義して、Putする時、Getした後にそこに忘れずにId, Nameを取り出したり移し替えたりして頑張る。 これを自動でやってくれるライブラリがgoonである。 IncompleteKeyはPutした後でも値は変わらない key := datastore.NewIncompleteKey(c, "Test", nil) newKey, err := datastore.Put(c, key, foo) // keyはIncomp
GoConでは毎回エラー処理について面白い知見が得られる.Go Conference 2014 autumn においては(実際のトークではないが)居酒屋にて@JxckさんがRob Pike氏から以下のようなテクニックを紹介してもらっていた. Errors are values - The Go Blog Golang Error Handling lesson by Rob Pike これはWrite(やRead)のエラー処理が複数続く場合にerrWriter を定義して複数のエラー処理を一箇所にまとめてコードをすっきりとさせるテクニックであった. そして今回の Go Conference 2016 spring のkeynoteにおいてもDave Cheney氏から(僕にとっては)新たなエラー処理テクニックが紹介された. Gocon Spring 2016 実際に使ってみて/コードを読ん
最近、goji(golang web framework)触り始めていて、 centos7のnginxからunix domain socket経由で、 gojiに繋ごうとしても繋がらなかった。 原因はすごい下らない単純な理由だったが、メモ。 ※ちなみに、よくあるsocketファイルのuser/権限の話ではない。systemdの話 事象 nginxでdomain socketを指定してbrowserアクセスすると、以下エラー web上 502 Bag Gateway nginx の error log connect() to unix:/tmp/go.sock failed (2: No such file or directory) while connecting to upstream, client: **.**.**.**, server: _, request: "GET /
io.Readerを使った読み込み ファイルの読み込みやTCPコネクションのメッセージ読み込みに、io.Readerインターフェースを実装したstructのReadメソッドを使う 以下その例 package main import "fmt" import "os" func main() { file, _ := os.Open("sample.txt") bufferSize := 4 buf := make([]byte, bufferSize) n, e := file.Read(buf) fmt.Println("LENGTH READ:", n, "ERROR:", e) fmt.Println("---RESULT---\n", string(buf)) } 問題 上記の例では、読み込んだトークンを流し込むバッファー([]byte型)を自分で定義して、ReaderのReadに
I find that Go's I/O framework is one of its major strengths: The io.Reader and io.Writer abstractions make it easy to create composable programs It's a great example of how to use interfaces in your own programs One of my recent discoveries is io.Pipe(). Let's for example encode some JSON and send it as an HTTP POST body. You could use a bytes.Buffer to store the result of the encoding and then p
Setting up Intellij IDEA for your Golang project 2016-02-04 After two full months of testing Golang plugin in Intellij IDEA, I’m happy I can say it’s sufficient and there are no real limits in using it - no more Sublimes, Atoms, LiteIDEs. If you’re not a Vim user and want to try real IDE with Golang, “go” for this. Here’re the steps to make your live easier too. Installing Go and Golang plugin I a
lambda_procでは、node側でJSONを整形し、goに対して一行のJSONとして渡します (Line Delimited JSON)。 go側のヘルパーライブラリがJSONを整形し、goのメイン関数に渡します。 返答は、適当なstructを返すとlambda_procのヘルパーライブラリがJSONに整形してnodeに返してくれます。 実際にベンチマークにgoのソースコードは以下となります。標準出力に書いてしまうとnode側に渡ってしまうので、ログは標準エラー出力に書く必要があります。 package main import ( "encoding/json" "log" "os" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/se
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く