Add configurable codecs for broker/transport
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
type Options struct {
|
||||
Addrs []string
|
||||
Secure bool
|
||||
Codec Codec
|
||||
TLSConfig *tls.Config
|
||||
|
||||
// Other options for implementations of the interface
|
||||
@@ -96,6 +97,14 @@ func Secure(b bool) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// Codec sets the codec used for encoding/decoding used where
|
||||
// a broker does not support headers
|
||||
func SetCodec(c Codec) Option {
|
||||
return func(o *Options) {
|
||||
o.Codec = c
|
||||
}
|
||||
}
|
||||
|
||||
// Specify TLS Config
|
||||
func TLSConfig(t *tls.Config) Option {
|
||||
return func(o *Options) {
|
||||
|
Reference in New Issue
Block a user