Documentation ¶
Index ¶
- func DecodeType(resolver Resolver, desc *descriptor.FieldDescriptorProto) v1beta1.ValueType
- func FindFieldByName(descriptor *descriptor.DescriptorProto, name string) *descriptor.FieldDescriptorProto
- func GetBuffer() *proto.Buffer
- func GetFileDescSet(path string) (*descriptor.FileDescriptorSet, error)
- func PutBuffer(b *proto.Buffer)
- func ToFloat(v interface{}) (float64, bool)
- func ToInt64(v interface{}) (int64, bool)
- type Decoder
- type Encoder
- type Resolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeType ¶
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 ¶
func FindFieldByName(descriptor *descriptor.DescriptorProto, name string) *descriptor.FieldDescriptorProto
FindFieldByName finds a field descriptor by its name.
func GetFileDescSet ¶
func GetFileDescSet(path string) (*descriptor.FileDescriptorSet, error)
GetFileDescSet reads proto filedescriptor set from a given file.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder transforms protobuf-encoded bytes to attribute values.
func NewDecoder ¶
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).
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder transforms yaml that represents protobuf data into []byte
func NewEncoder ¶
func NewEncoder(fds *descriptor.FileDescriptorSet) *Encoder
NewEncoder creates an Encoder
type Resolver ¶
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 ¶
func NewResolver(fds *descriptor.FileDescriptorSet) Resolver
NewResolver creates a new resolver