command

package
v8.24.2 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(c *proto.Command) ([]byte, error)

Marshal marshals a Command.

func MarshalLoadChunkRequest

func MarshalLoadChunkRequest(lr *proto.LoadChunkRequest) ([]byte, error)

MarshalLoadChunkRequest marshals a LoadChunkRequest command

func MarshalLoadRequest

func MarshalLoadRequest(lr *proto.LoadRequest) ([]byte, error)

MarshalLoadRequest marshals a LoadRequest command

func MarshalNoop

func MarshalNoop(c *proto.Noop) ([]byte, error)

MarshalNoop marshals a Noop command

func Unmarshal

func Unmarshal(b []byte, c *proto.Command) error

Unmarshal unmarshals a Command

func UnmarshalLoadChunkRequest

func UnmarshalLoadChunkRequest(b []byte, lr *proto.LoadChunkRequest) error

UnmarshalLoadChunkRequest unmarshals a LoadChunkRequest command

func UnmarshalLoadRequest

func UnmarshalLoadRequest(b []byte, lr *proto.LoadRequest) error

UnmarshalLoadRequest unmarshals a LoadRequest command

func UnmarshalNoop

func UnmarshalNoop(b []byte, c *proto.Noop) error

UnmarshalNoop unmarshals a Noop command

func UnmarshalSubCommand

func UnmarshalSubCommand(c *proto.Command, m pb.Message) error

UnmarshalSubCommand unmarshals a sub command m. It assumes that m is the correct type.

Types

type RequestMarshaler

type RequestMarshaler struct {
	BatchThreshold   int
	SizeThreshold    int
	ForceCompression bool
}

RequestMarshaler marshals Request objects, potentially performing gzip compression.

func NewRequestMarshaler

func NewRequestMarshaler() *RequestMarshaler

NewRequestMarshaler returns an initialized RequestMarshaler.

func (*RequestMarshaler) Marshal

func (m *RequestMarshaler) Marshal(r Requester) ([]byte, bool, error)

Marshal marshals a Requester object, returning a byte slice, a bool indicating whether the contents are compressed, or an error.

func (*RequestMarshaler) Stats

func (m *RequestMarshaler) Stats() map[string]interface{}

Stats returns status and diagnostic information about the RequestMarshaler.

type Requester

type Requester interface {
	pb.Message
	GetRequest() *proto.Request
}

Requester is the interface objects must support to be marshaled successfully.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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