config

package
v0.0.0-...-ec5ffe5 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package config is a generated protocol buffer package.

It is generated from these files:

mixer/v1/config/cfg.proto

It has these top-level messages:

AttributeManifest
Rule
Action
Instance
Handler

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	// Required. Fully qualified name of the handler to invoke.
	// Must match the `name` of a [Handler][istio.mixer.v1.config.Handler.name].
	Handler string `protobuf:"bytes,2,opt,name=handler,proto3" json:"handler,omitempty"`
	// Required. Each value must match the fully qualified name of the
	// [Instance][istio.mixer.v1.config.Instance.name]s.
	// Referenced instances are evaluated by resolving the attributes/literals for all the fields.
	// The constructed objects are then passed to the `handler` referenced within this action.
	Instances []string `protobuf:"bytes,3,rep,name=instances" json:"instances,omitempty"`
}

Action describes which Handler[istio.mixer.v1.config.Handler] to invoke and what data to pass to it for processing.

The following example instructs Mixer to invoke 'prometheus-handler' handler and pass it the object constructed using the instance 'RequestCountByService'

```yaml

handler: prometheus-handler
instances:
- RequestCountByService

```

func (*Action) Descriptor

func (*Action) Descriptor() ([]byte, []int)

func (*Action) GetHandler

func (m *Action) GetHandler() string

func (*Action) GetInstances

func (m *Action) GetInstances() []string

func (*Action) ProtoMessage

func (*Action) ProtoMessage()

func (*Action) Reset

func (m *Action) Reset()

func (*Action) String

func (m *Action) String() string

type AttributeManifest

type AttributeManifest struct {
	// Optional. The revision of this document. Assigned by server.
	Revision string `protobuf:"bytes,1,opt,name=revision,proto3" json:"revision,omitempty"`
	// Required. Name of the component producing these attributes. This can be
	// the proxy (with the canonical name "istio-proxy") or the name of an
	// `attributes` kind adapter in Mixer.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// The set of attributes this Istio component will be responsible for producing at runtime.
	// We map from attribute name to the attribute's specification. The name of an attribute,
	// which is how attributes are referred to in aspect configuration, must conform to:
	//
	//     Name = IDENT { SEPARATOR IDENT };
	//
	// Where `IDENT` must match the regular expression `[a-z][a-z0-9]+` and `SEPARATOR` must
	// match the regular expression `[\.-]`.
	//
	// Attribute names must be unique within a single Istio deployment. The set of canonical
	// attributes are described at https://istio.io/docs/reference/attribute-vocabulary.html.
	// Attributes not in that list should be named with a component-specific suffix such as
	// request.count-my.component
	Attributes map[string]*AttributeManifest_AttributeInfo `` /* 147-byte string literal not displayed */
}

AttributeManifest describes a set of Attributes produced by some component of an Istio deployment.

func (*AttributeManifest) Descriptor

func (*AttributeManifest) Descriptor() ([]byte, []int)

func (*AttributeManifest) GetAttributes

func (*AttributeManifest) GetName

func (m *AttributeManifest) GetName() string

func (*AttributeManifest) GetRevision

func (m *AttributeManifest) GetRevision() string

func (*AttributeManifest) ProtoMessage

func (*AttributeManifest) ProtoMessage()

func (*AttributeManifest) Reset

func (m *AttributeManifest) Reset()

func (*AttributeManifest) String

func (m *AttributeManifest) String() string

type AttributeManifest_AttributeInfo

type AttributeManifest_AttributeInfo struct {
	// Optional. A human-readable description of the attribute's purpose.
	Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
	// Required. The type of data carried by this attribute.
	ValueType istio_mixer_v1_config_descriptor.ValueType `` /* 137-byte string literal not displayed */
}

AttributeInfo describes the schema of an Istio `Attribute`.

## Istio Attributes

Istio uses `attributes` to describe runtime activities of Istio services. An Istio attribute carries a specific piece of information about an activity, such as the error code of an API request, the latency of an API request, or the original IP address of a TCP connection. The attributes are often generated and consumed by different services. For example, a frontend service can generate an authenticated user attribute and pass it to a backend service for access control purpose.

To simplify the system and improve developer experience, Istio uses shared attribute definitions across all components. For example, the same authenticated user attribute will be used for logging, monitoring, analytics, billing, access control, auditing. Many Istio components provide their functionality by collecting, generating, and operating on attributes. For example, the proxy collects the error code attribute, and the logging stores it into a log.

## Design

Each Istio attribute must conform to an `AttributeInfo` in an `AttributeManifest` in the current Istio deployment at runtime. An [`AttributeInfo`][istio.mixer.v1.config] is used to define an attribute's metadata: the type of its value and a detailed description that explains the semantics of the attribute type. Each attribute's name is globally unique; in other words an attribute name can only appear once across all manifests.

The runtime presentation of an attribute is intentionally left out of this specification, because passing attribute using JSON, XML, or Protocol Buffers does not change the semantics of the attribute. Different implementations can choose different representations based on their needs.

## HTTP Mapping

Because many systems already have REST APIs, it makes sense to define a standard HTTP mapping for Istio attributes that are compatible with typical REST APIs. The design is to map one attribute to one HTTP header, the attribute name and value becomes the HTTP header name and value. The actual encoding scheme will be decided later.

func (*AttributeManifest_AttributeInfo) Descriptor

func (*AttributeManifest_AttributeInfo) Descriptor() ([]byte, []int)

func (*AttributeManifest_AttributeInfo) GetDescription

func (m *AttributeManifest_AttributeInfo) GetDescription() string

func (*AttributeManifest_AttributeInfo) GetValueType

func (*AttributeManifest_AttributeInfo) ProtoMessage

func (*AttributeManifest_AttributeInfo) ProtoMessage()

func (*AttributeManifest_AttributeInfo) Reset

func (*AttributeManifest_AttributeInfo) String

type Handler

type Handler struct {
	// Required. Must be unique in the entire mixer configuration. Used by [Actions][istio.mixer.v1.config.Action.handler]
	// to refer to this handler.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Required. The name of a specific adapter implementation. An adapter's
	// implementation name is typically a constant in its code.
	Adapter string `protobuf:"bytes,2,opt,name=adapter,proto3" json:"adapter,omitempty"`
	// Optional. Depends on adapter implementation. Struct representation of a
	// proto defined by the adapter implementation; this varies depending on the value of field `adapter`.
	Params interface{} `protobuf:"bytes,3,opt,name=params" json:"params,omitempty"`
}

Handler allows the operator to configure a specific adapter implementation. Each adapter implementation defines its own `params` proto.

In the following example we define a `metrics` handler using the Mixer's prepackaged prometheus adapter. This handler doesn't require any parameters.

```yaml name: prometheus-handler adapter: prometheus params: ```

func (*Handler) Descriptor

func (*Handler) Descriptor() ([]byte, []int)

func (*Handler) GetAdapter

func (m *Handler) GetAdapter() string

func (*Handler) GetName

func (m *Handler) GetName() string

func (*Handler) GetParams

func (m *Handler) GetParams() interface{}

func (*Handler) ProtoMessage

func (*Handler) ProtoMessage()

func (*Handler) Reset

func (m *Handler) Reset()

func (*Handler) String

func (m *Handler) String() string

type Instance

type Instance struct {
	// Required. The name of this instance
	//
	// Must be unique amongst other Instances in scope. Used by [Action][istio.mixer.v1.config.Action] to refer
	// to an instance produced by this instance.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Required. The name of the template this instance creates instances for.
	// The value must match the name of the available template in scope.
	Template string `protobuf:"bytes,2,opt,name=template,proto3" json:"template,omitempty"`
	// Required. Depends on referenced template. Struct representation of a
	// proto defined by the template; this varies depending on the value of field `template`.
	Params interface{} `protobuf:"bytes,3,opt,name=params" json:"params,omitempty"`
}

An Instance tells Mixer how to create instances for particular template.

Instance is defined by the operator. Instance is defined relative to a known template. Their purpose is to tell Mixer how to use attributes or literals to produce instances of the specified template at runtime.

The following example instructs Mixer to construct an instance associated with template 'istio.mixer.adapter.metric.Metric'. It provides a mapping from the template's fields to expressions. Instances produced with this instance can be referenced by [Actions][istio.mixer.v1.config.Action] using name 'RequestCountByService'.

```yaml

  • name: RequestCountByService template: istio.mixer.adapter.metric.Metric params: value: 1 dimensions: source: source.service destination_ip: destination.ip

```

func (*Instance) Descriptor

func (*Instance) Descriptor() ([]byte, []int)

func (*Instance) GetName

func (m *Instance) GetName() string

func (*Instance) GetParams

func (m *Instance) GetParams() interface{}

func (*Instance) GetTemplate

func (m *Instance) GetTemplate() string

func (*Instance) ProtoMessage

func (*Instance) ProtoMessage()

func (*Instance) Reset

func (m *Instance) Reset()

func (*Instance) String

func (m *Instance) String() string

type Rule

type Rule struct {
	// Required. Match is an attribute based predicate. When Mixer receives a
	// request it evaluates the match expression and executes all the associated `actions`
	// if the match evaluates to true.
	//
	// A few example match:
	//
	// * an empty match evaluates to `true`
	// * `true`, a boolean literal; a rule with this match will always be executed
	// * `destination.service == ratings*` selects any request targeting a service whose
	// name starts with "ratings"
	// * `attr1 == "20" && attr2 == "30"` logical AND, OR, and NOT are also available
	Match string `protobuf:"bytes,1,opt,name=match,proto3" json:"match,omitempty"`
	// Optional. The actions that will be executed when match evaluates to `true`.
	Actions []*Action `protobuf:"bytes,2,rep,name=actions" json:"actions,omitempty"`
}

A Rule is a selector and a set of intentions to be executed when the selector is `true`

The following example instructs Mixer to invoke 'prometheus-handler' handler for all services and pass it the instance constructed using the 'RequestCountByService' instance.

```yaml

  • match: destination.service == "*" actions:
  • handler: prometheus-handler instances:
  • RequestCountByService

```

func (*Rule) Descriptor

func (*Rule) Descriptor() ([]byte, []int)

func (*Rule) GetActions

func (m *Rule) GetActions() []*Action

func (*Rule) GetMatch

func (m *Rule) GetMatch() string

func (*Rule) ProtoMessage

func (*Rule) ProtoMessage()

func (*Rule) Reset

func (m *Rule) Reset()

func (*Rule) String

func (m *Rule) String() string

Directories

Path Synopsis
Package client is a generated protocol buffer package.
Package client is a generated protocol buffer package.
Package descriptor is a generated protocol buffer package.
Package descriptor is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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