settings

package
v0.0.0-...-d7985ca Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContextKey = settingsKeyType{}

Functions

func AsMetaDuration

func AsMetaDuration(key string, target **metav1.Duration) configmap.ParseFunc

AsMetaDuration parses the value at key as a time.Duration into the target, if it exists.

func ToContext

func ToContext(ctx context.Context, s *Settings) context.Context

Types

type Injectable

type Injectable interface {
	ConfigMap() string
	Inject(context.Context, *v1.ConfigMap) (context.Context, error)
}

Injectable defines a ConfigMap registration to be loaded into context on startup

type Settings

type Settings struct {
	BatchMaxDuration      *metav1.Duration
	BatchIdleDuration     *metav1.Duration
	TTLAfterNotRegistered *metav1.Duration
	// This feature flag is temporary and will be removed in the near future.
	DriftEnabled bool
}

+k8s:deepcopy-gen=true

func FromContext

func FromContext(ctx context.Context) *Settings

func (*Settings) ConfigMap

func (*Settings) ConfigMap() string

func (*Settings) DeepCopy

func (in *Settings) DeepCopy() *Settings

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Settings.

func (*Settings) DeepCopyInto

func (in *Settings) DeepCopyInto(out *Settings)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Settings) Inject

func (*Settings) Inject(ctx context.Context, cm *v1.ConfigMap) (context.Context, error)

Inject creates a Settings from the supplied ConfigMap

func (*Settings) Validate

func (in *Settings) Validate() (err error)

Jump to

Keyboard shortcuts

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