forked from edgexfoundry/go-mod-messaging
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration.go
27 lines (21 loc) · 908 Bytes
/
configuration.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package redis
import "github.com/edgexfoundry/go-mod-messaging/v3/internal/pkg"
type redisOptionalConfigurationBuilder struct {
options map[string]string
}
// NewRedisOptionalConfigurationBuilder creates a new builder which aids in creating the map that can be used as
// MessageBusConfig.Optional field to provide additional configuration options.
func NewRedisOptionalConfigurationBuilder() *redisOptionalConfigurationBuilder {
return &redisOptionalConfigurationBuilder{
options: make(map[string]string),
}
}
// Build constructs a map with the configured configuration options.
func (r *redisOptionalConfigurationBuilder) Build() map[string]string {
return r.options
}
// Password adds a password to the optional configuration properties.
func (r *redisOptionalConfigurationBuilder) Password(password string) *redisOptionalConfigurationBuilder {
r.options[pkg.Password] = password
return r
}