command

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2025 License: GPL-3.0 Imports: 8 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 ExecuteQueryRequest

type ExecuteQueryRequest struct {
	Request         *Request           `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"`
	Timings         bool               `protobuf:"varint,2,opt,name=timings,proto3" json:"timings,omitempty"`
	Level           QueryRequest_Level `protobuf:"varint,3,opt,name=level,proto3,enum=command.QueryRequest_Level" json:"level,omitempty"`
	Freshness       int64              `protobuf:"varint,4,opt,name=freshness,proto3" json:"freshness,omitempty"`
	FreshnessStrict bool               `protobuf:"varint,5,opt,name=freshness_strict,json=freshnessStrict,proto3" json:"freshness_strict,omitempty"`
	// contains filtered or unexported fields
}

type Parameter

type Parameter struct {

	// Types that are assignable to Value:
	//
	//	*Parameter_I
	//	*Parameter_D
	//	*Parameter_B
	//	*Parameter_Y
	//	*Parameter_S
	Value isParameter_Value `protobuf_oneof:"value"`
	Name  string            `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

Not yet completely implemented, need to think of all the edge cases

type QueryRequest_Level

type QueryRequest_Level int32
const (
	QueryRequest_QUERY_REQUEST_LEVEL_NONE   QueryRequest_Level = 0
	QueryRequest_QUERY_REQUEST_LEVEL_WEAK   QueryRequest_Level = 1
	QueryRequest_QUERY_REQUEST_LEVEL_STRONG QueryRequest_Level = 2
	QueryRequest_QUERY_REQUEST_LEVEL_AUTO   QueryRequest_Level = 3
)

type Request

type Request struct {
	Transaction bool         `protobuf:"varint,1,opt,name=transaction,proto3" json:"transaction,omitempty"`
	Statements  []*Statement `protobuf:"bytes,2,rep,name=statements,proto3" json:"statements,omitempty"`
	DbTimeout   int64        `protobuf:"varint,3,opt,name=dbTimeout,proto3" json:"dbTimeout,omitempty"`
	// contains filtered or unexported fields
}

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.

type Statement

type Statement struct {
	Sql        string       `protobuf:"bytes,1,opt,name=sql,proto3" json:"sql,omitempty"`
	Parameters []*Parameter `protobuf:"bytes,2,rep,name=parameters,proto3" json:"parameters,omitempty"`
	ForceQuery bool         `protobuf:"varint,3,opt,name=forceQuery,proto3" json:"forceQuery,omitempty"`
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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