proto

package
v0.0.0-...-9649366 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package proto is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	MaxMessageSize *int                              `yaml:"maxMessageSize"`
	BytesPool      *pool.BucketizedPoolConfiguration `yaml:"bytesPool"`
}

Configuration configures an Encoder or a Decoder.

func (*Configuration) NewOptions

func (c *Configuration) NewOptions(
	iOpts instrument.Options,
) Options

NewOptions creates a new Options.

type Decoder

type Decoder interface {
	// Decode decodes the unmarshaler.
	Decode(m Unmarshaler) error

	// ResetReader resets the reader.
	ResetReader(r io.Reader)
}

Decoder decodes into an unmarshaler.

func NewDecoder

func NewDecoder(r io.Reader, opts Options) Decoder

NewDecoder decodes a new decoder, the implementation is not thread safe.

type Encoder

type Encoder interface {
	// Encode encodes the marshaler.
	Encode(m Marshaler) error

	// Bytes returns the encoded bytes, the bytes could be reused by
	// the next encode call.
	Bytes() []byte
}

Encoder encodes the marshaler.

func NewEncoder

func NewEncoder(opts Options) Encoder

NewEncoder creates a new encoder, the implementation is not thread safe.

type Marshaler

type Marshaler interface {
	// Size returns the size of the marshalled bytes.
	Size() int

	// MarshalTo marshals the marshaler into the given byte slice.
	MarshalTo(data []byte) (int, error)
}

Marshaler can be marshalled.

type MockDecoder

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

MockDecoder is a mock of Decoder interface

func NewMockDecoder

func NewMockDecoder(ctrl *gomock.Controller) *MockDecoder

NewMockDecoder creates a new mock instance

func (*MockDecoder) Decode

func (m *MockDecoder) Decode(arg0 Unmarshaler) error

Decode mocks base method

func (*MockDecoder) EXPECT

func (m *MockDecoder) EXPECT() *MockDecoderMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockDecoder) ResetReader

func (m *MockDecoder) ResetReader(arg0 io.Reader)

ResetReader mocks base method

type MockDecoderMockRecorder

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

MockDecoderMockRecorder is the mock recorder for MockDecoder

func (*MockDecoderMockRecorder) Decode

func (mr *MockDecoderMockRecorder) Decode(arg0 interface{}) *gomock.Call

Decode indicates an expected call of Decode

func (*MockDecoderMockRecorder) ResetReader

func (mr *MockDecoderMockRecorder) ResetReader(arg0 interface{}) *gomock.Call

ResetReader indicates an expected call of ResetReader

type MockEncoder

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

MockEncoder is a mock of Encoder interface

func NewMockEncoder

func NewMockEncoder(ctrl *gomock.Controller) *MockEncoder

NewMockEncoder creates a new mock instance

func (*MockEncoder) Bytes

func (m *MockEncoder) Bytes() []byte

Bytes mocks base method

func (*MockEncoder) EXPECT

func (m *MockEncoder) EXPECT() *MockEncoderMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockEncoder) Encode

func (m *MockEncoder) Encode(arg0 Marshaler) error

Encode mocks base method

type MockEncoderMockRecorder

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

MockEncoderMockRecorder is the mock recorder for MockEncoder

func (*MockEncoderMockRecorder) Bytes

func (mr *MockEncoderMockRecorder) Bytes() *gomock.Call

Bytes indicates an expected call of Bytes

func (*MockEncoderMockRecorder) Encode

func (mr *MockEncoderMockRecorder) Encode(arg0 interface{}) *gomock.Call

Encode indicates an expected call of Encode

type Options

type Options interface {
	// MaxMessageSize returns the maximum message size.
	MaxMessageSize() int

	// SetMaxMessageSize sets the maximum message size.
	SetMaxMessageSize(value int) Options

	// BytesPool returns the bytes pool.
	BytesPool() pool.BytesPool

	// SetBytesPool sets the bytes pool.
	SetBytesPool(value pool.BytesPool) Options
}

Options configures a encoder or decoder.

func NewOptions

func NewOptions() Options

NewOptions creates a new Options.

type Unmarshaler

type Unmarshaler interface {
	// Unmarshal unmarshals the unmarshaler from the given byte slice.
	Unmarshal(data []byte) error
}

Unmarshaler can be unmarshalled from bytes.

Jump to

Keyboard shortcuts

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