yaml

package
Version: v0.0.0-...-46d7da7 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindFieldByName

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

FindFieldByName finds a field descriptor by its name.

func GetBuffer

func GetBuffer() *proto.Buffer

GetBuffer returns a new buffer from the pool

func GetFileDescSet

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

GetFileDescSet reads proto filedescriptor set from a given file.

func PutBuffer

func PutBuffer(b *proto.Buffer)

PutBuffer returns the buffer back to the pool

func ToFloat

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

ToFloat type casts input to float64 if it is possible.

func ToInt64

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

ToInt64 type casts input to int64 if it is possible.

Types

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

func (*Encoder) EncodeBytes

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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