mirror of
https://github.com/oarkflow/mq.git
synced 2025-10-04 15:42:49 +08:00
feat: Add README.md
This commit is contained in:
14
options.go
14
options.go
@@ -16,6 +16,10 @@ type Options struct {
|
||||
initialDelay time.Duration
|
||||
maxBackoff time.Duration
|
||||
jitterPercent float64
|
||||
useTLS bool // Add a flag to enable/disable TLS
|
||||
tlsCertPath string // Path to TLS certificate
|
||||
tlsKeyPath string // Path to TLS private key
|
||||
tlsCAPath string // Path to the Certificate Authority (optional)
|
||||
}
|
||||
|
||||
func defaultOptions() Options {
|
||||
@@ -39,6 +43,16 @@ func WithBrokerURL(url string) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// Option to enable/disable TLS
|
||||
func WithTLS(enableTLS bool, certPath, keyPath, caPath string) Option {
|
||||
return func(o *Options) {
|
||||
o.useTLS = enableTLS
|
||||
o.tlsCertPath = certPath
|
||||
o.tlsKeyPath = keyPath
|
||||
o.tlsCAPath = caPath
|
||||
}
|
||||
}
|
||||
|
||||
// WithSyncMode -
|
||||
func WithSyncMode(mode bool) Option {
|
||||
return func(opts *Options) {
|
||||
|
Reference in New Issue
Block a user