Documentation ¶
Overview ¶
Package config handles configuration ingestion and processing. validator 1. Accepts new configuration from user 2. Validates configuration 3. Produces a "ValidatedConfig" runtime
- It is validated and actionable configuration
- It resolves the configuration to a list of Combined {aspect, adapter} configs given an attribute.Bag.
- Combined config has complete information needed to dispatch aspect
Index ¶
- Constants
- func GetScopes(attr string, domain string, scopes []string) ([]string, error)
- func NewCompatFSStore(globalConfigFile string, serviceConfigFile string) (store.KeyValueStore, error)
- type API
- type APIResponse
- type AdapterToAspectMapper
- type AspectParams
- type AspectValidator
- type AspectValidatorFinder
- type BuilderValidatorFinder
- type ChangeListener
- type Kind
- type KindSet
- type Manager
- type Resolver
- type Validated
Constants ¶
const ( AccessLogsKindName = "access-logs" ApplicationLogsKindName = "application-logs" AttributesKindName = "attributes" DenialsKindName = "denials" ListsKindName = "lists" MetricsKindName = "metrics" QuotasKindName = "quotas" )
Name of all supported aspect kinds.
Variables ¶
This section is empty.
Functions ¶
func GetScopes ¶
GetScopes returns configuration scopes that apply given a target service k8s example: domain maps to global attr - my-svc.my-namespace.svc.cluster.local domain - svc.cluster.local --> "global", "my-namespace.svc.cluster.local", "my-svc.my-namespace.svc.cluster.local" ordering of scopes is from least specific to most specific.
func NewCompatFSStore ¶
func NewCompatFSStore(globalConfigFile string, serviceConfigFile string) (store.KeyValueStore, error)
NewCompatFSStore creates and returns an fsStore using old style This should be removed once we migrate all configs to new style configs.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API defines and implements the configuration API. The server constructs and uses a validator for validations The server uses store.KeyValueStore to persist keys.
func NewAPI ¶
func NewAPI(version string, port uint16, tc expr.TypeChecker, aspectFinder AspectValidatorFinder, builderFinder BuilderValidatorFinder, findAspects AdapterToAspectMapper, store store.KeyValueStore) *API
NewAPI creates a new API server
type APIResponse ¶
type APIResponse struct { Data interface{} `json:"data,omitempty"` Status rpc.Status `json:"status,omitempty"` }
APIResponse defines the shape of the api response.
type AdapterToAspectMapper ¶
AdapterToAspectMapper returns the set of aspect kinds implemented by the given builder.
type AspectParams ¶
AspectParams describes configuration parameters for an aspect.
type AspectValidator ¶
type AspectValidator interface { // DefaultConfig returns a default configuration struct for this // adapter. This will be used by the configuration system to establish // the shape of the block of configuration state passed to the NewAspect method. DefaultConfig() (c AspectParams) // ValidateConfig determines whether the given configuration meets all correctness requirements. ValidateConfig(c AspectParams, validator expr.TypeChecker, finder descriptor.Finder) *adapter.ConfigErrors }
AspectValidator describes a type that is able to validate Aspect configuration.
type AspectValidatorFinder ¶
type AspectValidatorFinder func(kind Kind) (AspectValidator, bool)
AspectValidatorFinder is used to find specific underlying validators. Manager registry and adapter registry should implement this interface so ConfigValidators can be uniformly accessed.
type BuilderValidatorFinder ¶
type BuilderValidatorFinder func(name string) (adapter.ConfigValidator, bool)
BuilderValidatorFinder is used to find specific underlying validators. Manager registry and adapter registry should implement this interface so ConfigValidators can be uniformly accessed.
type ChangeListener ¶
type ChangeListener interface {
ConfigChange(cfg Resolver, df descriptor.Finder)
}
ChangeListener listens for config change notifications.
type Kind ¶
type Kind uint
Kind of aspect
type KindSet ¶
type KindSet uint
KindSet is a set of aspects by kind.
type Manager ¶
Manager represents the config Manager. It is responsible for fetching and receiving configuration changes. It applies validated changes to the registered config change listeners. api.Handler listens for config changes.
func NewManager ¶
func NewManager(eval expr.Evaluator, aspectFinder AspectValidatorFinder, builderFinder BuilderValidatorFinder, findAspects AdapterToAspectMapper, store store.KeyValueStore, loopDelay time.Duration, identityAttribute string, identityAttributeDomain string) *Manager
NewManager returns a config.Manager. Eval validates and evaluates selectors. It is also used downstream for attribute mapping. AspectFinder finds aspect validator given aspect 'Kind'. BuilderFinder finds builder validator given builder 'Impl'. LoopDelay determines how often configuration is updated. The following fields will be eventually replaced by a repository location. At present we use GlobalConfig and ServiceConfig as command line input parameters. GlobalConfig specifies the location of Global Config. ServiceConfig specifies the location of Service config.
func (*Manager) LastError ¶
LastError returns last error encountered by the manager while processing config.
func (*Manager) Register ¶
func (c *Manager) Register(cc ChangeListener)
Register makes the ConfigManager aware of a ConfigChangeListener.
type Resolver ¶
type Resolver interface { // Resolve resolves configuration to a list of combined configs. Resolve(bag attribute.Bag, kindSet KindSet, strict bool) ([]*pb.Combined, error) // ResolveUnconditional resolves configuration for unconditioned rules. // Unconditioned rules are those rules with the empty selector (""). ResolveUnconditional(bag attribute.Bag, kindSet KindSet, strict bool) ([]*pb.Combined, error) }
Resolver resolves configuration to a list of combined configs.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package istio_mixer_v1_config is a generated protocol buffer package.
|
Package istio_mixer_v1_config is a generated protocol buffer package. |
Package redis provides the Redis implementation of store interfaces.
|
Package redis provides the Redis implementation of store interfaces. |
Package store provides the interface to the backend storage for the config and the default fsstore implementation.
|
Package store provides the interface to the backend storage for the config and the default fsstore implementation. |