config

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: Apache-2.0 Imports: 8 Imported by: 6

Documentation

Overview

Package config holds the typed objects that define the schemas for assorted ConfigMap objects on which the Revision controller depends.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToContext

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

ToContext persists the configuration to the context.

Types

type Config

type Config struct {
	*apiconfig.Config
	Deployment    *deployment.Config
	Logging       *logging.Config
	Network       *network.Config
	Observability *metrics.ObservabilityConfig
	Tracing       *pkgtracing.Config
}

Config contains the configmaps requires for revision reconciliation.

func FromContext

func FromContext(ctx context.Context) *Config

FromContext loads the configuration from the context.

type Store

type Store struct {
	*configmap.UntypedStore
	// contains filtered or unexported fields
}

Store is a typed wrapper around configmap.UntypedStore to handle our configmaps.

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 for Revisions

func (*Store) Load

func (s *Store) Load() *Config

Load returns the config from the store.

func (*Store) ToContext

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

ToContext persists the config on the context.

func (*Store) WatchConfigs added in v0.17.0

func (s *Store) WatchConfigs(cmw configmap.Watcher)

WatchConfigs uses the provided configmap.Watcher to setup watches for the config names provided in the Constructors map

Jump to

Keyboard shortcuts

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