template

package
v0.0.0-...-0000b31 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvalAll

func EvalAll(expressions map[string]string, attrs attribute.Bag, eval expr.Evaluator) (map[string]interface{}, error)

EvalAll evaluates the value of the expression map using the passed in attributes.

Types

type BuilderSupportsTemplateFn

type BuilderSupportsTemplateFn func(hndlrBuilder adapter.HandlerBuilder) bool

BuilderSupportsTemplateFn check if the handlerBuilder supports template.

type HandlerSupportsTemplateFn

type HandlerSupportsTemplateFn func(hndlr adapter.Handler) bool

HandlerSupportsTemplateFn check if the handler supports template.

type InferTypeFn

type InferTypeFn func(proto.Message, TypeEvalFn) (proto.Message, error)

InferTypeFn does Type inference from the Instance.params proto message.

type Info

type Info struct {
	Name                    string
	Impl                    string
	Variety                 adptTmpl.TemplateVariety
	BldrInterfaceName       string
	HndlrInterfaceName      string
	CtrCfg                  proto.Message
	InferType               InferTypeFn
	SetType                 SetTypeFn
	BuilderSupportsTemplate BuilderSupportsTemplateFn
	HandlerSupportsTemplate HandlerSupportsTemplateFn
	ProcessReport           ProcessReportFn
	ProcessCheck            ProcessCheckFn
	ProcessQuota            ProcessQuotaFn
	ProcessGenAttrs         ProcessGenerateAttributesFn

	AttributeManifests []*istio_mixer_v1_config.AttributeManifest
}

Info contains all the information related a template like Default instance params, type inference method etc.

type ProcessCheckFn

type ProcessCheckFn func(ctx context.Context, instName string, instCfg proto.Message, attrs attribute.Bag,
	mapper expr.Evaluator, handler adapter.Handler) (adapter.CheckResult, error)

ProcessCheckFn instantiates the instance object and dispatches them to the handler.

type ProcessGenerateAttributesFn

type ProcessGenerateAttributesFn func(ctx context.Context, instName string, instCfg proto.Message, attrs attribute.Bag,
	mapper expr.Evaluator, handler adapter.Handler) (*attribute.MutableBag, error)

ProcessGenerateAttributesFn instantiates the instance object and dispatches them to the attribute generating handler.

type ProcessQuotaFn

type ProcessQuotaFn func(ctx context.Context, quotaName string, quotaCfg proto.Message, attrs attribute.Bag,
	mapper expr.Evaluator, handler adapter.Handler, args adapter.QuotaArgs) (adapter.QuotaResult, error)

ProcessQuotaFn instantiates the instance object and dispatches them to the handler.

type ProcessReportFn

type ProcessReportFn func(ctx context.Context, instCfg map[string]proto.Message, attrs attribute.Bag,
	mapper expr.Evaluator, handler adapter.Handler) error

ProcessReportFn instantiates the instance object and dispatches them to the handler.

type Repository

type Repository interface {
	GetTemplateInfo(template string) (Info, bool)
	SupportsTemplate(hndlrBuilder adapter.HandlerBuilder, tmpl string) (bool, string)
}

Repository defines all the helper functions to access the generated template specific types and fields.

func NewRepository

func NewRepository(templateInfos map[string]Info) Repository

NewRepository returns an implementation of Repository

type SetTypeFn

type SetTypeFn func(types map[string]proto.Message, builder adapter.HandlerBuilder)

SetTypeFn dispatches the inferred types to handlers

type TypeEvalFn

type TypeEvalFn func(string) (pb.ValueType, error)

TypeEvalFn evaluates an expression and returns the ValueType for the expression.

Jump to

Keyboard shortcuts

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