update the gossiper

This commit is contained in:
Asim Aslam
2018-12-06 18:19:05 +00:00
parent 1ed2b589a2
commit b343420af6
6 changed files with 509 additions and 254 deletions

View File

@@ -0,0 +1,17 @@
package gossip
import (
"context"
"github.com/micro/go-micro/registry"
)
type contextSecretKey struct{}
// Secret specifies an encryption key. The value should be either
// 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256.
func Secret(k []byte) registry.Option {
return func(o *registry.Options) {
o.Context = context.WithValue(o.Context, contextSecretKey{}, k)
}
}