1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-03-29 20:39:48 +02:00
2021-11-08 08:59:14 +00:00

39 lines
644 B
Go

package stream
import "crypto/tls"
// Options which are used to configure the redis stream
type Options struct {
Address string
User string
Password string
TLSConfig *tls.Config
}
// Option is a function which configures options
type Option func(o *Options)
func Address(addr string) Option {
return func(o *Options) {
o.Address = addr
}
}
func User(user string) Option {
return func(o *Options) {
o.User = user
}
}
func Password(password string) Option {
return func(o *Options) {
o.Password = password
}
}
func TLSConfig(tlsConfig *tls.Config) Option {
return func(o *Options) {
o.TLSConfig = tlsConfig
}
}