proto

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Unlicense Imports: 9 Imported by: 0

Documentation

Overview

Package proto contains protobuf files and functions for MicroDB protocol

Index

Constants

This section is empty.

Variables

View Source
var File_microdb_proto protoreflect.FileDescriptor

Functions

func UnmarshalValues

func UnmarshalValues(vs []*Value) []interface{}

UnmarshalValues unmarshals an array of MicroDB value types into Go types.

Types

type DriverResult

type DriverResult struct {
	ResultLastInsertId int64 `protobuf:"varint,1,opt,name=resultLastInsertId,proto3" json:"resultLastInsertId,omitempty"`
	ResultRowsAffected int64 `protobuf:"varint,2,opt,name=resultRowsAffected,proto3" json:"resultRowsAffected,omitempty"`
	// contains filtered or unexported fields
}

func (*DriverResult) Descriptor deprecated

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

Deprecated: Use DriverResult.ProtoReflect.Descriptor instead.

func (*DriverResult) GetResultLastInsertId

func (x *DriverResult) GetResultLastInsertId() int64

func (*DriverResult) GetResultRowsAffected

func (x *DriverResult) GetResultRowsAffected() int64

func (*DriverResult) LastInsertId

func (x *DriverResult) LastInsertId() (int64, error)

LastInsertId returns the database's auto-generated ID after, for example, an INSERT into a table with primary key.

func (*DriverResult) ProtoMessage

func (*DriverResult) ProtoMessage()

func (*DriverResult) ProtoReflect

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

func (*DriverResult) Reset

func (x *DriverResult) Reset()

func (*DriverResult) RowsAffected

func (x *DriverResult) RowsAffected() (int64, error)

RowsAffected returns the number of rows affected by the query.

func (*DriverResult) String

func (x *DriverResult) String() string

type NullValue

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

func (*NullValue) Descriptor deprecated

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

Deprecated: Use NullValue.ProtoReflect.Descriptor instead.

func (*NullValue) ProtoMessage

func (*NullValue) ProtoMessage()

func (*NullValue) ProtoReflect

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

func (*NullValue) Reset

func (x *NullValue) Reset()

func (*NullValue) String

func (x *NullValue) String() string

type QueryRequest

type QueryRequest struct {
	Query string   `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
	Args  []*Value `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"`
	// contains filtered or unexported fields
}

func (*QueryRequest) Descriptor deprecated

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

Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead.

func (*QueryRequest) GetArgs

func (x *QueryRequest) GetArgs() []*Value

func (*QueryRequest) GetQuery

func (x *QueryRequest) GetQuery() string

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 RowUpdate

type RowUpdate struct {
	Row []*Value `protobuf:"bytes,1,rep,name=row,proto3" json:"row,omitempty"`
	// contains filtered or unexported fields
}

func (*RowUpdate) Descriptor deprecated

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

Deprecated: Use RowUpdate.ProtoReflect.Descriptor instead.

func (*RowUpdate) GetRow

func (x *RowUpdate) GetRow() []*Value

func (*RowUpdate) ProtoMessage

func (*RowUpdate) ProtoMessage()

func (*RowUpdate) ProtoReflect

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

func (*RowUpdate) Reset

func (x *RowUpdate) Reset()

func (*RowUpdate) String

func (x *RowUpdate) String() string

type Value

type Value struct {

	// Types that are assignable to TypedValue:
	//	*Value_Varchar
	//	*Value_Integer
	//	*Value_Decimal
	//	*Value_Boolean
	//	*Value_Null
	//	*Value_Timestamp
	TypedValue isValue_TypedValue `protobuf_oneof:"typed_value"`
	// contains filtered or unexported fields
}

func MarshalCanalValue added in v0.1.7

func MarshalCanalValue(colType int, v interface{}) *Value

MarshalCanalValue marshals a canal values into a MicroDB value type.

func MarshalCanalValues added in v0.1.7

func MarshalCanalValues(table *schema.Table, is []interface{}) []*Value

MarshalCanalValues marshals an array of canal values into MicroDB value types.

func MarshalDriverValues

func MarshalDriverValues(args []driver.NamedValue) []*Value

MarshalDriverValues marshals an array of database driver values into MicroDB value types.

func MarshalValue

func MarshalValue(i interface{}) *Value

MarshalValue marshals any Go type into a MicroDB value type. nolint // Allow longer method accounts for all data types.

func MarshalValues

func MarshalValues(is []interface{}) []*Value

MarshalValues marshals an array of any Go types into MicroDB value types.

func (*Value) Descriptor deprecated

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

Deprecated: Use Value.ProtoReflect.Descriptor instead.

func (*Value) GetBoolean

func (x *Value) GetBoolean() bool

func (*Value) GetDecimal

func (x *Value) GetDecimal() float32

func (*Value) GetInteger

func (x *Value) GetInteger() int64

func (*Value) GetInterface

func (x *Value) GetInterface() interface{}

GetInterface unmarshals a MicroDB value type into a Go type.

func (*Value) GetNull

func (x *Value) GetNull() *NullValue

func (*Value) GetTimestamp

func (x *Value) GetTimestamp() *timestamppb.Timestamp

func (*Value) GetTypedValue

func (m *Value) GetTypedValue() isValue_TypedValue

func (*Value) GetVarchar

func (x *Value) GetVarchar() string

func (*Value) ProtoMessage

func (*Value) ProtoMessage()

func (*Value) ProtoReflect

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

func (*Value) Reset

func (x *Value) Reset()

func (*Value) String

func (x *Value) String() string

type Value_Boolean

type Value_Boolean struct {
	Boolean bool `protobuf:"varint,4,opt,name=boolean,proto3,oneof"`
}

type Value_Decimal

type Value_Decimal struct {
	Decimal float32 `protobuf:"fixed32,3,opt,name=decimal,proto3,oneof"`
}

type Value_Integer

type Value_Integer struct {
	Integer int64 `protobuf:"varint,2,opt,name=integer,proto3,oneof"`
}

type Value_Null

type Value_Null struct {
	Null *NullValue `protobuf:"bytes,5,opt,name=null,proto3,oneof"`
}

type Value_Timestamp

type Value_Timestamp struct {
	Timestamp *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=timestamp,proto3,oneof"`
}

type Value_Varchar

type Value_Varchar struct {
	Varchar string `protobuf:"bytes,1,opt,name=varchar,proto3,oneof"`
}

type WriteQueryReply

type WriteQueryReply struct {
	Ok     bool          `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
	Msg    string        `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	Result *DriverResult `protobuf:"bytes,3,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*WriteQueryReply) Descriptor deprecated

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

Deprecated: Use WriteQueryReply.ProtoReflect.Descriptor instead.

func (*WriteQueryReply) GetMsg

func (x *WriteQueryReply) GetMsg() string

func (*WriteQueryReply) GetOk

func (x *WriteQueryReply) GetOk() bool

func (*WriteQueryReply) GetResult

func (x *WriteQueryReply) GetResult() *DriverResult

func (*WriteQueryReply) ProtoMessage

func (*WriteQueryReply) ProtoMessage()

func (*WriteQueryReply) ProtoReflect

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

func (*WriteQueryReply) Reset

func (x *WriteQueryReply) Reset()

func (*WriteQueryReply) String

func (x *WriteQueryReply) String() string

Jump to

Keyboard shortcuts

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