protobuf

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package protobuf is a concrete implementation of the encoding abstractions.

Index

Constants

View Source
const (
	// Type definition.
	Type string = "application/x-protobuf"
	// TypeGoogle definition.
	TypeGoogle string = "application/x-google-protobuf"
)

Variables

This section is empty.

Functions

func Decode

func Decode(data io.Reader, v interface{}) error

Decode a protobuf input in the form of a reader.

func DecodeRaw

func DecodeRaw(data []byte, v interface{}) error

DecodeRaw a protobuf input in the form of a byte slice.

func Encode

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

Encode a model to protobuf.

Types

type Test

type Test struct {
	Label                *string  `protobuf:"bytes,1,req,name=label" json:"label,omitempty"`
	Type                 *int32   `protobuf:"varint,2,opt,name=type" json:"type,omitempty"`
	Reps                 []int64  `protobuf:"varint,3,rep,name=reps" json:"reps,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Test) Descriptor

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

func (*Test) GetLabel

func (m *Test) GetLabel() string

func (*Test) GetReps

func (m *Test) GetReps() []int64

func (*Test) GetType

func (m *Test) GetType() int32

func (*Test) ProtoMessage

func (*Test) ProtoMessage()

func (*Test) Reset

func (m *Test) Reset()

func (*Test) String

func (m *Test) String() string

func (*Test) XXX_DiscardUnknown

func (m *Test) XXX_DiscardUnknown()

func (*Test) XXX_Marshal

func (m *Test) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Test) XXX_Merge

func (m *Test) XXX_Merge(src proto.Message)

func (*Test) XXX_Size

func (m *Test) XXX_Size() int

func (*Test) XXX_Unmarshal

func (m *Test) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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