handleroptions

package
v1.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// M3DBServiceName is the service name for M3DB.
	M3DBServiceName = "m3db"
	// M3AggregatorServiceName is the service name for M3Aggregator.
	M3AggregatorServiceName = "m3aggregator"
	// M3CoordinatorServiceName is the service name for M3Coordinator.
	M3CoordinatorServiceName = "m3coordinator"
)

Variables

This section is empty.

Functions

func AllowedServices

func AllowedServices() []string

AllowedServices returns the list of valid M3 services.

func IsAllowedService

func IsAllowedService(svc string) bool

IsAllowedService returns whether a service name is a valid M3 service.

Types

type M3AggServiceOptions

type M3AggServiceOptions struct {
	MaxAggregationWindowSize time.Duration
	WarmupDuration           time.Duration
}

M3AggServiceOptions contains the service options that are specific to the M3Agg service.

type ServiceNameAndDefaults

type ServiceNameAndDefaults struct {
	ServiceName string
	Defaults    []ServiceOptionsDefault
}

ServiceNameAndDefaults is the params used when identifying a service and it's service option defaults.

type ServiceOptions

type ServiceOptions struct {
	ServiceName        string
	ServiceEnvironment string
	ServiceZone        string

	M3Agg *M3AggServiceOptions

	DryRun bool
	Force  bool
}

ServiceOptions are the options for Service.

func NewServiceOptions

func NewServiceOptions(
	service ServiceNameAndDefaults,
	header http.Header,
	m3AggOpts *M3AggServiceOptions,
) ServiceOptions

NewServiceOptions returns a ServiceOptions based on the provided values.

func (*ServiceOptions) KVOverrideOptions

func (opts *ServiceOptions) KVOverrideOptions() kv.OverrideOptions

KVOverrideOptions constructs KV overrides from the current service options.

func (*ServiceOptions) ServiceID

func (opts *ServiceOptions) ServiceID() services.ServiceID

ServiceID constructs a cluster services ID from the options.

func (*ServiceOptions) Validate

func (opts *ServiceOptions) Validate() error

Validate ensures the service options are valid.

type ServiceOptionsDefault

type ServiceOptionsDefault func(o ServiceOptions) ServiceOptions

ServiceOptionsDefault is a default to apply to service options.

func WithDefaultServiceEnvironment

func WithDefaultServiceEnvironment(env string) ServiceOptionsDefault

WithDefaultServiceEnvironment returns the default service environment.

func WithDefaultServiceZone

func WithDefaultServiceZone(zone string) ServiceOptionsDefault

WithDefaultServiceZone returns the default service zone.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL