command

package
v0.0.0-...-854fb4c Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	QueryRequest_Level_name = map[int32]string{
		0: "QUERY_REQUEST_LEVEL_NONE",
		1: "QUERY_REQUEST_LEVEL_WEAK",
		2: "QUERY_REQUEST_LEVEL_STRONG",
	}
	QueryRequest_Level_value = map[string]int32{
		"QUERY_REQUEST_LEVEL_NONE":   0,
		"QUERY_REQUEST_LEVEL_WEAK":   1,
		"QUERY_REQUEST_LEVEL_STRONG": 2,
	}
)

Enum value maps for QueryRequest_Level.

View Source
var (
	Command_Type_name = map[int32]string{
		0: "COMMAND_TYPE_UNKNOWN",
		1: "COMMAND_TYPE_QUERY",
		2: "COMMAND_TYPE_EXECUTE",
		3: "COMMAND_TYPE_NOOP",
	}
	Command_Type_value = map[string]int32{
		"COMMAND_TYPE_UNKNOWN": 0,
		"COMMAND_TYPE_QUERY":   1,
		"COMMAND_TYPE_EXECUTE": 2,
		"COMMAND_TYPE_NOOP":    3,
	}
)

Enum value maps for Command_Type.

View Source
var File_command_proto protoreflect.FileDescriptor

Functions

func Marshal

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

Marshal marshals a Command.

func MarshalNoop

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

MarshalNoop marshals a Noop command

func Unmarshal

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

Unmarshal unmarshals a Command

func UnmarshalNoop

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

UnmarshalNoop unmarshals a Noop command

func UnmarshalSubCommand

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

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

Types

type Command

type Command struct {
	Type       Command_Type `protobuf:"varint,1,opt,name=type,proto3,enum=command.Command_Type" json:"type,omitempty"`
	SubCommand []byte       `protobuf:"bytes,2,opt,name=sub_command,json=subCommand,proto3" json:"sub_command,omitempty"`
	Compressed bool         `protobuf:"varint,3,opt,name=compressed,proto3" json:"compressed,omitempty"`
	// contains filtered or unexported fields
}

func (*Command) Descriptor deprecated

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

Deprecated: Use Command.ProtoReflect.Descriptor instead.

func (*Command) GetCompressed

func (x *Command) GetCompressed() bool

func (*Command) GetSubCommand

func (x *Command) GetSubCommand() []byte

func (*Command) GetType

func (x *Command) GetType() Command_Type

func (*Command) ProtoMessage

func (*Command) ProtoMessage()

func (*Command) ProtoReflect

func (x *Command) ProtoReflect() protoreflect.Message

func (*Command) Reset

func (x *Command) Reset()

func (*Command) String

func (x *Command) String() string

type Command_Type

type Command_Type int32
const (
	Command_COMMAND_TYPE_UNKNOWN Command_Type = 0
	Command_COMMAND_TYPE_QUERY   Command_Type = 1
	Command_COMMAND_TYPE_EXECUTE Command_Type = 2
	Command_COMMAND_TYPE_NOOP    Command_Type = 3
)

func (Command_Type) Descriptor

func (Command_Type) Enum

func (x Command_Type) Enum() *Command_Type

func (Command_Type) EnumDescriptor deprecated

func (Command_Type) EnumDescriptor() ([]byte, []int)

Deprecated: Use Command_Type.Descriptor instead.

func (Command_Type) Number

func (Command_Type) String

func (x Command_Type) String() string

func (Command_Type) Type

type ExecuteRequest

type ExecuteRequest 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"`
	// contains filtered or unexported fields
}

func (*ExecuteRequest) Descriptor deprecated

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

Deprecated: Use ExecuteRequest.ProtoReflect.Descriptor instead.

func (*ExecuteRequest) GetRequest

func (x *ExecuteRequest) GetRequest() *Request

func (*ExecuteRequest) GetTimings

func (x *ExecuteRequest) GetTimings() bool

func (*ExecuteRequest) ProtoMessage

func (*ExecuteRequest) ProtoMessage()

func (*ExecuteRequest) ProtoReflect

func (x *ExecuteRequest) ProtoReflect() protoreflect.Message

func (*ExecuteRequest) Reset

func (x *ExecuteRequest) Reset()

func (*ExecuteRequest) String

func (x *ExecuteRequest) String() string

type Noop

type Noop struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*Noop) Descriptor deprecated

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

Deprecated: Use Noop.ProtoReflect.Descriptor instead.

func (*Noop) GetId

func (x *Noop) GetId() string

func (*Noop) ProtoMessage

func (*Noop) ProtoMessage()

func (*Noop) ProtoReflect

func (x *Noop) ProtoReflect() protoreflect.Message

func (*Noop) Reset

func (x *Noop) Reset()

func (*Noop) String

func (x *Noop) String() string

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"`
	// contains filtered or unexported fields
}

func (*Parameter) Descriptor deprecated

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

Deprecated: Use Parameter.ProtoReflect.Descriptor instead.

func (*Parameter) GetB

func (x *Parameter) GetB() bool

func (*Parameter) GetD

func (x *Parameter) GetD() float64

func (*Parameter) GetI

func (x *Parameter) GetI() int64

func (*Parameter) GetS

func (x *Parameter) GetS() string

func (*Parameter) GetValue

func (m *Parameter) GetValue() isParameter_Value

func (*Parameter) GetY

func (x *Parameter) GetY() []byte

func (*Parameter) ProtoMessage

func (*Parameter) ProtoMessage()

func (*Parameter) ProtoReflect

func (x *Parameter) ProtoReflect() protoreflect.Message

func (*Parameter) Reset

func (x *Parameter) Reset()

func (*Parameter) String

func (x *Parameter) String() string

type Parameter_B

type Parameter_B struct {
	B bool `protobuf:"varint,3,opt,name=b,proto3,oneof"`
}

type Parameter_D

type Parameter_D struct {
	D float64 `protobuf:"fixed64,2,opt,name=d,proto3,oneof"`
}

type Parameter_I

type Parameter_I struct {
	I int64 `protobuf:"zigzag64,1,opt,name=i,proto3,oneof"`
}

type Parameter_S

type Parameter_S struct {
	S string `protobuf:"bytes,5,opt,name=s,proto3,oneof"`
}

type Parameter_Y

type Parameter_Y struct {
	Y []byte `protobuf:"bytes,4,opt,name=y,proto3,oneof"`
}

type QueryRequest

type QueryRequest 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"`
	// contains filtered or unexported fields
}

func (*QueryRequest) Descriptor deprecated

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

Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead.

func (*QueryRequest) GetFreshness

func (x *QueryRequest) GetFreshness() int64

func (*QueryRequest) GetLevel

func (x *QueryRequest) GetLevel() QueryRequest_Level

func (*QueryRequest) GetRequest

func (x *QueryRequest) GetRequest() *Request

func (*QueryRequest) GetTimings

func (x *QueryRequest) GetTimings() bool

func (*QueryRequest) ProtoMessage

func (*QueryRequest) ProtoMessage()

func (*QueryRequest) ProtoReflect

func (x *QueryRequest) ProtoReflect() protoreflect.Message

func (*QueryRequest) Reset

func (x *QueryRequest) Reset()

func (*QueryRequest) String

func (x *QueryRequest) String() string

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
)

func (QueryRequest_Level) Descriptor

func (QueryRequest_Level) Enum

func (QueryRequest_Level) EnumDescriptor deprecated

func (QueryRequest_Level) EnumDescriptor() ([]byte, []int)

Deprecated: Use QueryRequest_Level.Descriptor instead.

func (QueryRequest_Level) Number

func (QueryRequest_Level) String

func (x QueryRequest_Level) String() string

func (QueryRequest_Level) Type

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"`
	// contains filtered or unexported fields
}

func (*Request) Descriptor deprecated

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

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetStatements

func (x *Request) GetStatements() []*Statement

func (*Request) GetTransaction

func (x *Request) GetTransaction() bool

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

func (x *Request) ProtoReflect() protoreflect.Message

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

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 {
	proto.Message
	GetRequest() *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"`
	// contains filtered or unexported fields
}

func (*Statement) Descriptor deprecated

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

Deprecated: Use Statement.ProtoReflect.Descriptor instead.

func (*Statement) GetParameters

func (x *Statement) GetParameters() []*Parameter

func (*Statement) GetSql

func (x *Statement) GetSql() string

func (*Statement) ProtoMessage

func (*Statement) ProtoMessage()

func (*Statement) ProtoReflect

func (x *Statement) ProtoReflect() protoreflect.Message

func (*Statement) Reset

func (x *Statement) Reset()

func (*Statement) String

func (x *Statement) String() string

Jump to

Keyboard shortcuts

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