Version: v0.0.0-...-5253b6b Latest Latest

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

Go to latest
Published: Oct 27, 2017 License: Apache-2.0 Imports: 30 Imported by: 0




View Source
const (
	// DefaultConfigNamespace holds istio wide configuration.
	DefaultConfigNamespace = "istio-system"

	// DefaultIdentityAttribute is attribute that defines config scopes.
	DefaultIdentityAttribute = "destination.service"

	// ContextProtocolAttributeName is the attribute that defines the protocol context.
	ContextProtocolAttributeName = "context.protocol"

	// ContextProtocolTCP defines constant for tcp protocol.
	ContextProtocolTCP = "tcp"
View Source
const AttributeManifestKind = "attributemanifest"

AttributeManifestKind define the config kind name of attribute manifests.

View Source
const RulesKind = "rule"

RulesKind defines the config kind name of mixer rules.


This section is empty.


This section is empty.


type Action

type Action struct {
	// contains filtered or unexported fields

Action is the runtime representation of a configured action - cpb.Action. Configuration is processed to hydrate instance names to Instances and handler.

type Actions

type Actions interface {
	// Get gets the encapsulated actions.
	Get() []*Action

	// Done is used by the caller to indicate that
	// the resolved actions will not be used further.
	// This can be used for reference counting.

Actions combines []*Action with a lifecycle (Done) function.

type BuilderInfoFinder

type BuilderInfoFinder func(name string) (*adapter.Info, bool)

BuilderInfoFinder is used to find specific handlers Info for configuration.

type Controller

type Controller struct {
	// contains filtered or unexported fields

Controller is responsible for watching configuration using the Store2 API. Controller produces a resolver and installs it in the dispatcher. Controller consumes potentially inconsistent configuration state from the config store and produces a consistent snapshot. Controller must not panic on configuration problems, it should issues a warning and continue.

type Dispatcher

type Dispatcher interface {
	// Preprocess dispatches to the set of adapters that will run before any
	// other adapters in Mixer (aka: the Check, Report, Quota adapters).
	Preprocess(ctx context.Context, requestBag attribute.Bag, responseBag *attribute.MutableBag) error

	// Check dispatches to the set of adapters associated with the Check API method
	Check(ctx context.Context, requestBag attribute.Bag) (*adapter.CheckResult, error)

	// Report dispatches to the set of adapters associated with the Report API method
	Report(ctx context.Context, requestBag attribute.Bag) error

	// Quota dispatches to the set of adapters associated with the Quota API method
	Quota(ctx context.Context, requestBag attribute.Bag,
		qma *aspect.QuotaMethodArgs) (*adapter.QuotaResult, error)

Dispatcher dispatches incoming API calls to configured adapters.

func New

func New(eval expr.Evaluator, gp *pool.GoroutinePool, handlerPool *pool.GoroutinePool,
	identityAttribute string, defaultConfigNamespace string,
	s store.Store2, adapterInfo map[string]*adapter.Info,
	templateInfo map[string]template.Info) (Dispatcher, error)

New creates a new runtime Dispatcher Create a new controller and a dispatcher. Returns a ready to use dispatcher.

type HandlerEntry

type HandlerEntry struct {
	// Name of the handler
	Name string

	// Handler is the initialized handler object.
	Handler adapter.Handler

	// HandlerCreateError records error while creating the handler.
	HandlerCreateError error

	// Instances is the global list of instances associated with this handler.
	Instances map[string]bool
	// contains filtered or unexported fields

HandlerEntry is an entry in the runtime handler table.

type HandlerFactory

type HandlerFactory interface {
	Build(*pb.Handler, []*pb.Instance, adapter.Env) (adapter.Handler, error)

HandlerFactory builds adapter.Handler object from adapter and instances configuration.

func NewHandlerFactory

func NewHandlerFactory(tmplRepo TemplateFinder, expr expr.TypeChecker, df expr.AttributeDescriptorFinder,
	builderInfoFinder BuilderInfoFinder) HandlerFactory

NewHandlerFactory instantiates a HandlerFactory, the state of the HandlerFactory is only valid for a snapshot of a configuration. Therefore, a new HandlerFactory should be created upon every configuration change.

type Resolver

type Resolver interface {
	// Resolve resolves configuration to a list of actions.
	// The result is encapsulated in the Actions interface.
	Resolve(bag attribute.Bag, variety adptTmpl.TemplateVariety) (Actions, error)

Resolver represents the current snapshot of the configuration database and associated, initialized handlers.

type ResolverChangeListener

type ResolverChangeListener interface {
	ChangeResolver(rt Resolver)

ResolverChangeListener is notified when a new resolver is created due to config change.

type ResourceType

type ResourceType struct {
	// contains filtered or unexported fields

ResourceType codifies types of resources. resources apply to certain protocols or methods.

func (ResourceType) IsCheck

func (r ResourceType) IsCheck() bool

IsCheck returns true if resource is for HTTP

func (ResourceType) IsHTTP

func (r ResourceType) IsHTTP() bool

IsHTTP returns true if resource is for HTTP

func (ResourceType) IsPreprocess

func (r ResourceType) IsPreprocess() bool

IsPreprocess returns true if resource is for Preprocess

func (ResourceType) IsQuota

func (r ResourceType) IsQuota() bool

IsQuota returns true if resource is for IsQuota

func (ResourceType) IsReport

func (r ResourceType) IsReport() bool

IsReport returns true if resource is for Report

func (ResourceType) IsTCP

func (r ResourceType) IsTCP() bool

IsTCP returns true if resource is for TCP

func (ResourceType) String

func (r ResourceType) String() string

String return string presentation of const.

type Rule

type Rule struct {
	// contains filtered or unexported fields

Rule represents a runtime view of cpb.Rule.

func (Rule) String

func (r Rule) String() string

type TemplateFinder

type TemplateFinder interface {
	GetTemplateInfo(template string) (template.Info, bool)

TemplateFinder finds a template by name.

type VocabularyChangeListener

type VocabularyChangeListener interface {
	ChangeVocabulary(finder expr.AttributeDescriptorFinder)

VocabularyChangeListener is notified when attribute vocabulary changes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL