brokerdelivery

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

brokerdelivery holds the typed objects that define the schemas for default Broker delivery settings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigMapName

func ConfigMapName() string

ConfigMapName returns the name of the configmap to read for default Broker delivery settings.

func ToContext

func ToContext(ctx context.Context, c *Config) context.Context

ToContext attaches the provided Config to the provided context, returning the new context with the Config attached.

Types

type Config

type Config struct {
	BrokerDeliverySpecDefaults *Defaults
}

Config holds the collection of configurations that we attach to contexts. +k8s:deepcopy-gen=false

func FromContext

func FromContext(ctx context.Context) *Config

FromContext extracts a Config from the provided context.

func FromContextOrDefaults

func FromContextOrDefaults(ctx context.Context) *Config

FromContextOrDefaults is like FromContext, but when no Config is attached it returns a Config populated with the defaults for each of the Config fields.

type Defaults

type Defaults struct {
	// NamespaceDefaults are the Broker delivery spec defaults to use in specific namespaces. The namespace is
	// the key, the value is the defaults.
	NamespaceDefaults map[string]ScopedDefaults `json:"namespaceDefaults,omitempty"`
	// ClusterDefaults are the Broker delivery spec defaults to use for all namepaces that are not in
	// NamespaceDefaults.
	ClusterDefaults ScopedDefaults `json:"clusterDefaults,omitempty"`
}

Defaults includes the default values to be populated by the Webhook.

func NewDefaultsConfigFromConfigMap

func NewDefaultsConfigFromConfigMap(config *corev1.ConfigMap) (*Defaults, error)

NewDefaultsConfigFromConfigMap creates a Defaults from the supplied configMap.

func NewDefaultsConfigFromMap

func NewDefaultsConfigFromMap(data map[string]string) (*Defaults, error)

NewDefaultsConfigFromMap creates a Defaults from the supplied Map.

func (*Defaults) BackoffDelay

func (d *Defaults) BackoffDelay(ns string) *string

func (*Defaults) BackoffPolicy

func (d *Defaults) BackoffPolicy(ns string) *eventingduckv1.BackoffPolicyType

func (*Defaults) DeadLetterSink

func (d *Defaults) DeadLetterSink(ns string) *v1.Destination

func (*Defaults) DeepCopy

func (in *Defaults) DeepCopy() *Defaults

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

func (*Defaults) DeepCopyInto

func (in *Defaults) DeepCopyInto(out *Defaults)

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

func (*Defaults) Retry

func (d *Defaults) Retry(ns string) *int32

type ScopedDefaults

type ScopedDefaults struct {
	// ScopedDefaults implements the Broker delivery spec.
	*eventingduckv1.DeliverySpec
}

ScopedDefaults are the Broker delivery setting defaults.

func (*ScopedDefaults) DeepCopy

func (in *ScopedDefaults) DeepCopy() *ScopedDefaults

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

func (*ScopedDefaults) DeepCopyInto

func (in *ScopedDefaults) DeepCopyInto(out *ScopedDefaults)

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

type Store

type Store struct {
	*configmap.UntypedStore
}

Store is a typed wrapper around configmap.Untyped store to handle our ConfigMaps. +k8s:deepcopy-gen=false

func NewStore

func NewStore(logger configmap.Logger, onAfterStore ...func(name string, value interface{})) *Store

NewStore creates a new store of Configs and optionally calls functions when ConfigMaps are updated.

func (*Store) Load

func (s *Store) Load() *Config

Load creates a Config from the current config state of the Store.

func (*Store) ToContext

func (s *Store) ToContext(ctx context.Context) context.Context

ToContext attaches the current Config state to the provided context.

type StoreSingleton

type StoreSingleton struct {
	// contains filtered or unexported fields
}

+k8s:deepcopy-gen=false

func (*StoreSingleton) Store

func (s *StoreSingleton) Store(ctx context.Context, cmw configmap.Watcher) *Store

Jump to

Keyboard shortcuts

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