Help us shape the future of Go! Take the 2026 Go Developer Survey

proto

package
v0.16.4 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONReaderWriter added in v0.11.0

type JSONReaderWriter struct {
	*ReadJSON
	*WriteJSON
}

func NewJsonReaderWriter added in v0.11.0

func NewJsonReaderWriter(svc *dproto.ServiceDescriptor, convOpts *conv.Options) *JSONReaderWriter

type Message deprecated

type Message interface {
	Marshal() ([]byte, error)
	TryGetFieldByNumber(fieldNumber int) (interface{}, error)
	TrySetFieldByNumber(fieldNumber int, val interface{}) error
}

Deprecated: please use github.com/jhump/protoreflect/dynamic Message instead

func NewMessage deprecated

func NewMessage(descriptor MessageDescriptor) Message

Deprecated: please use github.com/jhump/protoreflect/dynamic NewMessage instead

type MessageDescriptor

type MessageDescriptor = *desc.MessageDescriptor

type MessageReader added in v0.9.0

type MessageReader interface {
	Read(ctx context.Context, method string, isClient bool, actualMsgBuf []byte) (interface{}, error)
}

MessageReader read from ActualMsgBuf with method and returns a string

type MessageWriter added in v0.9.0

type MessageWriter interface {
	Write(ctx context.Context, msg interface{}, method string, isClient bool) (interface{}, error)
}

MessageWriter writes to a converts json to protobufs wireformat and returns an output bytebuffer

type RawReader added in v0.14.0

type RawReader struct{}

RawReader implement of MessageReaderWithMethod

func NewRawReader added in v0.14.0

func NewRawReader() *RawReader

NewRawReader build RawReader

func (*RawReader) Read added in v0.14.0

func (m *RawReader) Read(ctx context.Context, method string, isClient bool, actualMsgBuf []byte) (interface{}, error)

Read returns the copy of data

type RawReaderWriter added in v0.14.0

type RawReaderWriter struct {
	*RawReader
	*RawWriter
}

func NewRawReaderWriter added in v0.14.0

func NewRawReaderWriter() *RawReaderWriter

type RawWriter added in v0.14.0

type RawWriter struct{}

RawWriter implement of MessageWriter

func NewRawWriter added in v0.14.0

func NewRawWriter() *RawWriter

NewRawWriter build RawWriter

func (*RawWriter) Write added in v0.14.0

func (m *RawWriter) Write(ctx context.Context, msg interface{}, method string, isClient bool) (interface{}, error)

Write returns the copy of data

type ReadJSON added in v0.9.0

type ReadJSON struct {
	// contains filtered or unexported fields
}

ReadJSON implement of MessageReaderWithMethod

func NewReadJSON added in v0.9.0

func NewReadJSON(svc *dproto.ServiceDescriptor, convOpts *conv.Options) *ReadJSON

NewReadJSON build ReadJSON according to ServiceDescriptor

func (*ReadJSON) Read added in v0.9.0

func (m *ReadJSON) Read(ctx context.Context, method string, isClient bool, actualMsgBuf []byte) (interface{}, error)

Read reads data from actualMsgBuf and convert to json string

type ServiceDescriptor

type ServiceDescriptor = *desc.ServiceDescriptor

type WriteJSON added in v0.9.0

type WriteJSON struct {
	// contains filtered or unexported fields
}

WriteJSON implement of MessageWriter

func NewWriteJSON added in v0.9.0

func NewWriteJSON(svc *dproto.ServiceDescriptor, convOpts *conv.Options) *WriteJSON

NewWriteJSON build WriteJSON according to ServiceDescriptor

func (*WriteJSON) Write added in v0.9.0

func (m *WriteJSON) Write(ctx context.Context, msg interface{}, method string, isClient bool) (interface{}, error)

Write converts msg to protobuf wire format and returns an output bytebuffer

Jump to

Keyboard shortcuts

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