istio: Index | Files

package dynamic

import ""


Package Files

auth.go builder.go encoder.go encoderUtil.go handler.go primitive.go valueTypeEncoder.go

func EncodeBool Uses

func EncodeBool(v interface{}, ba []byte) ([]byte, error)

EncodeBool encodes input as boolean.

func EncodeDouble Uses

func EncodeDouble(v interface{}, ba []byte) ([]byte, error)

EncodeDouble encode Double.

func EncodeEnum Uses

func EncodeEnum(v interface{}, ba []byte, enumValues []*descriptor.EnumValueDescriptorProto) ([]byte, error)

EncodeEnum encodes enum from string or int inputs

func EncodeFixed32 Uses

func EncodeFixed32(v interface{}, ba []byte) ([]byte, error)

EncodeFixed32 encodes FIXED32, SFIXED32

func EncodeFixed64 Uses

func EncodeFixed64(v interface{}, ba []byte) ([]byte, error)

EncodeFixed64 encodes FIXED64, SFIXED64

func EncodeFloat Uses

func EncodeFloat(v interface{}, ba []byte) ([]byte, error)

EncodeFloat encode Float.

func EncodeInt Uses

func EncodeInt(v interface{}, ba []byte) ([]byte, error)

EncodeInt encodes (U)INT(32/64)

func EncodeSInt32 Uses

func EncodeSInt32(v interface{}, ba []byte) ([]byte, error)

EncodeSInt32 encodes sint32 as zigzag

func EncodeSInt64 Uses

func EncodeSInt64(v interface{}, ba []byte) ([]byte, error)

EncodeSInt64 encodes sint64 as zigzag

func EncodeString Uses

func EncodeString(v interface{}, ba []byte) ([]byte, error)

EncodeString encodes string

func EncodeVarint Uses

func EncodeVarint(buf []byte, x uint64) ([]byte, int)

EncodeVarint -- encodeVarint no allocations

func EncodeVarintZeroExtend Uses

func EncodeVarintZeroExtend(ba []byte, x uint64, minBytes int) []byte

EncodeVarintZeroExtend encodes x as Varint in ba. Ensures that encoding is at least minBytes long.

type Builder Uses

type Builder struct {
    // contains filtered or unexported fields

Builder builds encoder based on data

func NewEncoderBuilder Uses

func NewEncoderBuilder(resolver yaml.Resolver, compiler lang.Compiler, skipUnknown bool) *Builder

NewEncoderBuilder creates an EncoderBuilder.

func (Builder) Build Uses

func (c Builder) Build(msgName string, data map[string]interface{}) (Encoder, error)

Build builds an Encoder

func (Builder) BuildWithLength Uses

func (c Builder) BuildWithLength(msgName string, data map[string]interface{}) (Encoder, error)

BuildWithLength builds an Encoder that also encodes length of the top level message.

type CheckOutput Uses

type CheckOutput struct {
    // contains filtered or unexported fields

CheckOutput is a generic container for the response of remote check calls with output. It is used to unpack the value using a combination of the static and dynamic decoders.

func (*CheckOutput) Bytes Uses

func (out *CheckOutput) Bytes(n wire.Number, v []byte)

Bytes implements proto decoding interface

func (*CheckOutput) Fixed32 Uses

func (out *CheckOutput) Fixed32(wire.Number, uint32)

Fixed32 implements proto decoding interface

func (*CheckOutput) Fixed64 Uses

func (out *CheckOutput) Fixed64(wire.Number, uint64)

Fixed64 implements proto decoding interface

func (*CheckOutput) Varint Uses

func (out *CheckOutput) Varint(wire.Number, uint64)

Varint implements proto decoding interface

type Codec Uses

type Codec struct {
    // contains filtered or unexported fields

Codec in no-op on the way out and unmarshals using either normal means or a custom dynamic decoder on the way in

func (Codec) Marshal Uses

func (c Codec) Marshal(v interface{}) ([]byte, error)

Marshal does a noo-op marshal if input in bytes, otherwise it is an error.

func (Codec) Name Uses

func (c Codec) Name() string

Name returns name of the codec.

func (Codec) Unmarshal Uses

func (c Codec) Unmarshal(data []byte, v interface{}) error

Unmarshal uses custom decoder or delegates to standard proto Unmarshal

type Encoder Uses

type Encoder interface {
    Encode(bag attribute.Bag, ba []byte) ([]byte, error)

Encoder transforms yaml/json that represents protobuf data into []byte String values (rvalues) are treated as expressions that are evaluated using attribute bag at runtime. Quoted String values are treated as literals.

func BuildPrimitiveEncoder Uses

func BuildPrimitiveEncoder(v interface{}, fld *descriptor.FieldDescriptorProto) (Encoder, error)

BuildPrimitiveEncoder encodes the given data and returns a static encoder.

func BuildPrimitiveEvalEncoder Uses

func BuildPrimitiveEvalEncoder(expr compiled.Expression, vt v1beta1.ValueType, fld *descriptor.FieldDescriptorProto) (Encoder, error)

BuildPrimitiveEvalEncoder returns an eval encoder given an expression and a target fieldEncoder

type Handler Uses

type Handler struct {
    // Name is used for debug
    Name string
    // contains filtered or unexported fields

Handler is the dynamic handler implementation

func BuildHandler Uses

func BuildHandler(name string, connConfig *policypb.Connection, sessionBased bool, adapterConfig proto.Marshaler,
    templateConfig []*TemplateConfig, insecureSkipVerify bool) (hh *Handler, err error)

BuildHandler creates a dynamic handler object exposing specific handler interfaces.

func (*Handler) Close Uses

func (h *Handler) Close() error

Close implements io.Closer api

func (*Handler) HandleRemoteCheck Uses

func (h *Handler) HandleRemoteCheck(ctx context.Context, encodedInstance *adapter.EncodedInstance,
    output *attribute.MutableBag, outPrefix string) (*adapter.CheckResult, error)

HandleRemoteCheck implements adapter.RemoteCheckHandler api

func (*Handler) HandleRemoteGenAttrs Uses

func (h *Handler) HandleRemoteGenAttrs(ctx context.Context, encodedInstance *adapter.EncodedInstance,
    out *attribute.MutableBag) error

HandleRemoteGenAttrs implements remote handler API.

func (*Handler) HandleRemoteQuota Uses

func (h *Handler) HandleRemoteQuota(ctx context.Context, encodedInstance *adapter.EncodedInstance,
    args *adapter.QuotaArgs) (*adapter.QuotaResult, error)

HandleRemoteQuota implements adapter.RemoteQuotaHandler api

func (*Handler) HandleRemoteReport Uses

func (h *Handler) HandleRemoteReport(ctx context.Context, encodedInstances []*adapter.EncodedInstance) error

HandleRemoteReport implements adapter.RemoteReportHandler api

type NamedEncoderBuilderFunc Uses

type NamedEncoderBuilderFunc func(m *descriptor.DescriptorProto, fd *descriptor.FieldDescriptorProto, v interface{}, compiler lang.Compiler) (Encoder, error)

NamedEncoderBuilderFunc funcs have a special way to process input for encoding specific types for example istio...Value field accepts user input in a specific way

type Svc Uses

type Svc struct {
    Name       string
    Pkg        string
    MethodName string
    InputType  string
    OutputType string

    TemplateName string
    // contains filtered or unexported fields

Svc encapsulates abstract service

func RemoteAdapterSvc Uses

func RemoteAdapterSvc(namePrefix string, res protoyaml.Resolver, sessionBased bool,
    adapterConfig proto.Marshaler, templateName string, variety v1beta1.TemplateVariety) (*Svc, error)

RemoteAdapterSvc returns RemoteAdapter service

func (Svc) GrpcPath Uses

func (s Svc) GrpcPath() string

GrpcPath returns grpc POST url for this service.

type TemplateConfig Uses

type TemplateConfig struct {
    Name         string
    TemplateName string
    FileDescSet  *descriptor.FileDescriptorSet
    Variety      v1beta1.TemplateVariety

TemplateConfig is template configuration

Package dynamic imports 36 packages (graph) and is imported by 4 packages. Updated 2020-06-04. Refresh now. Tools for package owners.