kv

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: May 29, 2019 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNamespaceValidator

func NewNamespaceValidator(opts NamespaceValidatorOptions) (namespace.Validator, error)

NewNamespaceValidator creates a new namespace validator.

Types

type NamespaceValidatorConfiguration

type NamespaceValidatorConfiguration struct {
	KVConfig               kv.OverrideConfiguration `yaml:"kvConfig"`
	InitWatchTimeout       *time.Duration           `yaml:"initWatchTimeout"`
	ValidNamespacesKey     string                   `yaml:"validNamespacesKey" validate:"nonzero"`
	DefaultValidNamespaces *[]string                `yaml:"defaultValidNamespaces"`
}

NamespaceValidatorConfiguration configures a KV-backed namespace validator.

func (*NamespaceValidatorConfiguration) NewNamespaceValidator

func (c *NamespaceValidatorConfiguration) NewNamespaceValidator(
	kvClient client.Client,
) (namespace.Validator, error)

NewNamespaceValidator creates a new namespace validator.

type NamespaceValidatorOptions

type NamespaceValidatorOptions interface {
	// SetInstrumentOptions sets the instrument options.
	SetInstrumentOptions(value instrument.Options) NamespaceValidatorOptions

	// InstrumentOptions returns the instrument options.
	InstrumentOptions() instrument.Options

	// SetKVStore sets the KV store for namespace validation.
	SetKVStore(value kv.Store) NamespaceValidatorOptions

	// KVStore returns the KV store for namespace validation.
	KVStore() kv.Store

	// SetInitWatchTimeout sets the initial watch timeout.
	SetInitWatchTimeout(value time.Duration) NamespaceValidatorOptions

	// InitWatchTimeout returns the initial watch timeout.
	InitWatchTimeout() time.Duration

	// SetValidNamespacesKey sets the KV key associated with valid namespaces.
	SetValidNamespacesKey(value string) NamespaceValidatorOptions

	// ValidNamespacesKey returns the KV key associated with valid namespaces.
	ValidNamespacesKey() string

	// SetDefaultValidNamespaces sets the default list of valid namespaces.
	SetDefaultValidNamespaces(value []string) NamespaceValidatorOptions

	// DefaultValidNamespaces returns the default list of valid namespaces.
	DefaultValidNamespaces() []string
}

NamespaceValidatorOptions provide a set of options for the KV-backed namespace validator.

func NewNamespaceValidatorOptions

func NewNamespaceValidatorOptions() NamespaceValidatorOptions

NewNamespaceValidatorOptions create a new set of namespace validator options.

Jump to

Keyboard shortcuts

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