-
Notifications
You must be signed in to change notification settings - Fork 94
/
highavailability_options.go
34 lines (29 loc) · 1.25 KB
/
highavailability_options.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
28
29
30
31
32
33
34
package component
import "github.com/go-playground/validator/v10"
type HighAvailabilityOptions struct {
BackendRedisQueuesEndpoint string `validate:"required"`
BackendRedisQueuesSentinelHosts string
BackendRedisQueuesSentinelRole string
BackendRedisStorageEndpoint string `validate:"required"`
BackendRedisStorageSentinelHosts string
BackendRedisStorageSentinelRole string
SystemDatabaseURL string `validate:"required"`
SystemRedisURL string `validate:"required"`
SystemRedisSentinelsHosts string
SystemRedisSentinelsRole string
SystemRedisNamespace string
SystemMessageBusRedisURL string `validate:"required"`
SystemMessageBusRedisSentinelsHosts string
SystemMessageBusRedisSentinelsRole string
SystemMessageBusRedisNamespace string
BackendRedisLabels map[string]string `validate:"required"`
SystemRedisLabels map[string]string `validate:"required"`
SystemDatabaseLabels map[string]string `validate:"required"`
}
func NewHighAvailabilityOptions() *HighAvailabilityOptions {
return &HighAvailabilityOptions{}
}
func (h *HighAvailabilityOptions) Validate() error {
validate := validator.New()
return validate.Struct(h)
}