istio: Index | Files | Directories

package yaml

import ""


Package Files

castUtil.go decoder.go encoder.go namedEncoder.go pool.go resolver.go

func DecodeType Uses

func DecodeType(resolver Resolver, desc *descriptor.FieldDescriptorProto) v1beta1.ValueType

DecodeType converts protobuf types to mixer's IL types. Note that due to absence of corresponding types for a variety of concrete values produced by the decoder, the returned value may be an unspecified type.

func FindFieldByName Uses

func FindFieldByName(descriptor *descriptor.DescriptorProto, name string) *descriptor.FieldDescriptorProto

FindFieldByName finds a field descriptor by its name.

func GetBuffer Uses

func GetBuffer() *proto.Buffer

GetBuffer returns a new buffer from the pool

func GetFileDescSet Uses

func GetFileDescSet(path string) (*descriptor.FileDescriptorSet, error)

GetFileDescSet reads proto filedescriptor set from a given file.

func PutBuffer Uses

func PutBuffer(b *proto.Buffer)

PutBuffer returns the buffer back to the pool

func ToFloat Uses

func ToFloat(v interface{}) (float64, bool)

ToFloat type casts input to float64 if it is possible.

func ToInt64 Uses

func ToInt64(v interface{}) (int64, bool)

ToInt64 type casts input to int64 if it is possible.

type Decoder Uses

type Decoder struct {
    // contains filtered or unexported fields

Decoder transforms protobuf-encoded bytes to attribute values.

func NewDecoder Uses

func NewDecoder(resolver Resolver, msgName string, fieldMask map[string]bool) *Decoder

NewDecoder creates a decoder specific to a dynamic proto descriptor. Additionally, it takes as input an optional field mask to avoid decoding unused field values. Field mask is keyed by the message proto field names. A nil field mask implies all fields are decoded. This decoder is specialized to a single-level proto schema (no nested field dereferences in the resulting output).

func (*Decoder) Decode Uses

func (d *Decoder) Decode(b []byte, out *attribute.MutableBag, attrPrefix string) error

Decode function parses wire-encoded bytes to attribute values. The keys are field names in the message specified by the field mask. Attribute prefix is appended to the field names in the output attribute bag.

type Encoder Uses

type Encoder struct {
    // contains filtered or unexported fields

Encoder transforms yaml that represents protobuf data into []byte

func NewEncoder Uses

func NewEncoder(fds *descriptor.FileDescriptorSet) *Encoder

NewEncoder creates an Encoder

func (*Encoder) EncodeBytes Uses

func (e *Encoder) EncodeBytes(data map[string]interface{}, msgName string, skipUnknown bool) ([]byte, error)

EncodeBytes creates []byte from a yaml representation of a proto.

type Resolver Uses

type Resolver interface {
    ResolveMessage(name string) *descriptor.DescriptorProto
    ResolveEnum(name string) *descriptor.EnumDescriptorProto

    // Resolve service contained in the proto
    ResolveService(namePrefix string) (svc *descriptor.ServiceDescriptorProto, pkg string)

Resolver type is used for finding and resolving references inside proto descriptors.

func NewResolver Uses

func NewResolver(fds *descriptor.FileDescriptorSet) Resolver

NewResolver creates a new resolver


wirePackage wire parses and formats the protobuf wire encoding.

Package yaml imports 17 packages (graph) and is imported by 4 packages. Updated 2019-11-18. Refresh now. Tools for package owners.