protodb

package
v0.0.0-...-f498596 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Operation_Type_name = map[int32]string{
	0: "SET",
	1: "DELETE",
}
View Source
var Operation_Type_value = map[string]int32{
	"SET":    0,
	"DELETE": 1,
}

Functions

func RegisterDBServer

func RegisterDBServer(s *grpc.Server, srv DBServer)

Types

type Batch

type Batch struct {
	Ops                  []*Operation `protobuf:"bytes,1,rep,name=ops,proto3" json:"ops,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

func NewPopulatedBatch

func NewPopulatedBatch(r randyDefs, easy bool) *Batch

func (*Batch) Descriptor

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

func (*Batch) Equal

func (this *Batch) Equal(that interface{}) bool

func (*Batch) GetOps

func (m *Batch) GetOps() []*Operation

func (*Batch) ProtoMessage

func (*Batch) ProtoMessage()

func (*Batch) Reset

func (m *Batch) Reset()

func (*Batch) String

func (m *Batch) String() string

func (*Batch) XXX_DiscardUnknown

func (m *Batch) XXX_DiscardUnknown()

func (*Batch) XXX_Marshal

func (m *Batch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Batch) XXX_Merge

func (m *Batch) XXX_Merge(src proto.Message)

func (*Batch) XXX_Size

func (m *Batch) XXX_Size() int

func (*Batch) XXX_Unmarshal

func (m *Batch) XXX_Unmarshal(b []byte) error

type DBClient

type DBClient interface {
	Init(ctx context.Context, in *Init, opts ...grpc.CallOption) (*Entity, error)
	Get(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Entity, error)
	GetStream(ctx context.Context, opts ...grpc.CallOption) (DB_GetStreamClient, error)
	Has(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Entity, error)
	Set(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Nothing, error)
	SetSync(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Nothing, error)
	Delete(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Nothing, error)
	DeleteSync(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Nothing, error)
	Iterator(ctx context.Context, in *Entity, opts ...grpc.CallOption) (DB_IteratorClient, error)
	ReverseIterator(ctx context.Context, in *Entity, opts ...grpc.CallOption) (DB_ReverseIteratorClient, error)
	// rpc print(Nothing) returns (Entity) {}
	Stats(ctx context.Context, in *Nothing, opts ...grpc.CallOption) (*Stats, error)
	BatchWrite(ctx context.Context, in *Batch, opts ...grpc.CallOption) (*Nothing, error)
	BatchWriteSync(ctx context.Context, in *Batch, opts ...grpc.CallOption) (*Nothing, error)
}

DBClient is the client API for DB service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewDBClient

func NewDBClient(cc *grpc.ClientConn) DBClient

type DBServer

type DBServer interface {
	Init(context.Context, *Init) (*Entity, error)
	Get(context.Context, *Entity) (*Entity, error)
	GetStream(DB_GetStreamServer) error
	Has(context.Context, *Entity) (*Entity, error)
	Set(context.Context, *Entity) (*Nothing, error)
	SetSync(context.Context, *Entity) (*Nothing, error)
	Delete(context.Context, *Entity) (*Nothing, error)
	DeleteSync(context.Context, *Entity) (*Nothing, error)
	Iterator(*Entity, DB_IteratorServer) error
	ReverseIterator(*Entity, DB_ReverseIteratorServer) error
	// rpc print(Nothing) returns (Entity) {}
	Stats(context.Context, *Nothing) (*Stats, error)
	BatchWrite(context.Context, *Batch) (*Nothing, error)
	BatchWriteSync(context.Context, *Batch) (*Nothing, error)
}

DBServer is the server API for DB service.

type DB_GetStreamClient

type DB_GetStreamClient interface {
	Send(*Entity) error
	Recv() (*Entity, error)
	grpc.ClientStream
}

type DB_GetStreamServer

type DB_GetStreamServer interface {
	Send(*Entity) error
	Recv() (*Entity, error)
	grpc.ServerStream
}

type DB_IteratorClient

type DB_IteratorClient interface {
	Recv() (*Iterator, error)
	grpc.ClientStream
}

type DB_IteratorServer

type DB_IteratorServer interface {
	Send(*Iterator) error
	grpc.ServerStream
}

type DB_ReverseIteratorClient

type DB_ReverseIteratorClient interface {
	Recv() (*Iterator, error)
	grpc.ClientStream
}

type DB_ReverseIteratorServer

type DB_ReverseIteratorServer interface {
	Send(*Iterator) error
	grpc.ServerStream
}

type Domain

type Domain struct {
	Start                []byte   `protobuf:"bytes,1,opt,name=start,proto3" json:"start,omitempty"`
	End                  []byte   `protobuf:"bytes,2,opt,name=end,proto3" json:"end,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func NewPopulatedDomain

func NewPopulatedDomain(r randyDefs, easy bool) *Domain

func (*Domain) Descriptor

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

func (*Domain) Equal

func (this *Domain) Equal(that interface{}) bool

func (*Domain) GetEnd

func (m *Domain) GetEnd() []byte

func (*Domain) GetStart

func (m *Domain) GetStart() []byte

func (*Domain) ProtoMessage

func (*Domain) ProtoMessage()

func (*Domain) Reset

func (m *Domain) Reset()

func (*Domain) String

func (m *Domain) String() string

func (*Domain) XXX_DiscardUnknown

func (m *Domain) XXX_DiscardUnknown()

func (*Domain) XXX_Marshal

func (m *Domain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Domain) XXX_Merge

func (m *Domain) XXX_Merge(src proto.Message)

func (*Domain) XXX_Size

func (m *Domain) XXX_Size() int

func (*Domain) XXX_Unmarshal

func (m *Domain) XXX_Unmarshal(b []byte) error

type Entity

type Entity struct {
	Id                   int32    `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Key                  []byte   `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	Value                []byte   `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
	Exists               bool     `protobuf:"varint,4,opt,name=exists,proto3" json:"exists,omitempty"`
	Start                []byte   `protobuf:"bytes,5,opt,name=start,proto3" json:"start,omitempty"`
	End                  []byte   `protobuf:"bytes,6,opt,name=end,proto3" json:"end,omitempty"`
	Err                  string   `protobuf:"bytes,7,opt,name=err,proto3" json:"err,omitempty"`
	CreatedAt            int64    `protobuf:"varint,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func NewPopulatedEntity

func NewPopulatedEntity(r randyDefs, easy bool) *Entity

func (*Entity) Descriptor

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

func (*Entity) Equal

func (this *Entity) Equal(that interface{}) bool

func (*Entity) GetCreatedAt

func (m *Entity) GetCreatedAt() int64

func (*Entity) GetEnd

func (m *Entity) GetEnd() []byte

func (*Entity) GetErr

func (m *Entity) GetErr() string

func (*Entity) GetExists

func (m *Entity) GetExists() bool

func (*Entity) GetId

func (m *Entity) GetId() int32

func (*Entity) GetKey

func (m *Entity) GetKey() []byte

func (*Entity) GetStart

func (m *Entity) GetStart() []byte

func (*Entity) GetValue

func (m *Entity) GetValue() []byte

func (*Entity) ProtoMessage

func (*Entity) ProtoMessage()

func (*Entity) Reset

func (m *Entity) Reset()

func (*Entity) String

func (m *Entity) String() string

func (*Entity) XXX_DiscardUnknown

func (m *Entity) XXX_DiscardUnknown()

func (*Entity) XXX_Marshal

func (m *Entity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Entity) XXX_Merge

func (m *Entity) XXX_Merge(src proto.Message)

func (*Entity) XXX_Size

func (m *Entity) XXX_Size() int

func (*Entity) XXX_Unmarshal

func (m *Entity) XXX_Unmarshal(b []byte) error

type Init

type Init struct {
	Type                 string   `protobuf:"bytes,1,opt,name=Type,proto3" json:"Type,omitempty"`
	Name                 string   `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"`
	Dir                  string   `protobuf:"bytes,3,opt,name=Dir,proto3" json:"Dir,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func NewPopulatedInit

func NewPopulatedInit(r randyDefs, easy bool) *Init

func (*Init) Descriptor

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

func (*Init) Equal

func (this *Init) Equal(that interface{}) bool

func (*Init) GetDir

func (m *Init) GetDir() string

func (*Init) GetName

func (m *Init) GetName() string

func (*Init) GetType

func (m *Init) GetType() string

func (*Init) ProtoMessage

func (*Init) ProtoMessage()

func (*Init) Reset

func (m *Init) Reset()

func (*Init) String

func (m *Init) String() string

func (*Init) XXX_DiscardUnknown

func (m *Init) XXX_DiscardUnknown()

func (*Init) XXX_Marshal

func (m *Init) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Init) XXX_Merge

func (m *Init) XXX_Merge(src proto.Message)

func (*Init) XXX_Size

func (m *Init) XXX_Size() int

func (*Init) XXX_Unmarshal

func (m *Init) XXX_Unmarshal(b []byte) error

type Iterator

type Iterator struct {
	Domain               *Domain  `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"`
	Valid                bool     `protobuf:"varint,2,opt,name=valid,proto3" json:"valid,omitempty"`
	Key                  []byte   `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
	Value                []byte   `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func NewPopulatedIterator

func NewPopulatedIterator(r randyDefs, easy bool) *Iterator

func (*Iterator) Descriptor

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

func (*Iterator) Equal

func (this *Iterator) Equal(that interface{}) bool

func (*Iterator) GetDomain

func (m *Iterator) GetDomain() *Domain

func (*Iterator) GetKey

func (m *Iterator) GetKey() []byte

func (*Iterator) GetValid

func (m *Iterator) GetValid() bool

func (*Iterator) GetValue

func (m *Iterator) GetValue() []byte

func (*Iterator) ProtoMessage

func (*Iterator) ProtoMessage()

func (*Iterator) Reset

func (m *Iterator) Reset()

func (*Iterator) String

func (m *Iterator) String() string

func (*Iterator) XXX_DiscardUnknown

func (m *Iterator) XXX_DiscardUnknown()

func (*Iterator) XXX_Marshal

func (m *Iterator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Iterator) XXX_Merge

func (m *Iterator) XXX_Merge(src proto.Message)

func (*Iterator) XXX_Size

func (m *Iterator) XXX_Size() int

func (*Iterator) XXX_Unmarshal

func (m *Iterator) XXX_Unmarshal(b []byte) error

type Nothing

type Nothing struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func NewPopulatedNothing

func NewPopulatedNothing(r randyDefs, easy bool) *Nothing

func (*Nothing) Descriptor

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

func (*Nothing) Equal

func (this *Nothing) Equal(that interface{}) bool

func (*Nothing) ProtoMessage

func (*Nothing) ProtoMessage()

func (*Nothing) Reset

func (m *Nothing) Reset()

func (*Nothing) String

func (m *Nothing) String() string

func (*Nothing) XXX_DiscardUnknown

func (m *Nothing) XXX_DiscardUnknown()

func (*Nothing) XXX_Marshal

func (m *Nothing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Nothing) XXX_Merge

func (m *Nothing) XXX_Merge(src proto.Message)

func (*Nothing) XXX_Size

func (m *Nothing) XXX_Size() int

func (*Nothing) XXX_Unmarshal

func (m *Nothing) XXX_Unmarshal(b []byte) error

type Operation

type Operation struct {
	Entity               *Entity        `protobuf:"bytes,1,opt,name=entity,proto3" json:"entity,omitempty"`
	Type                 Operation_Type `protobuf:"varint,2,opt,name=type,proto3,enum=protodb.Operation_Type" json:"type,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

func NewPopulatedOperation

func NewPopulatedOperation(r randyDefs, easy bool) *Operation

func (*Operation) Descriptor

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

func (*Operation) Equal

func (this *Operation) Equal(that interface{}) bool

func (*Operation) GetEntity

func (m *Operation) GetEntity() *Entity

func (*Operation) GetType

func (m *Operation) GetType() Operation_Type

func (*Operation) ProtoMessage

func (*Operation) ProtoMessage()

func (*Operation) Reset

func (m *Operation) Reset()

func (*Operation) String

func (m *Operation) String() string

func (*Operation) XXX_DiscardUnknown

func (m *Operation) XXX_DiscardUnknown()

func (*Operation) XXX_Marshal

func (m *Operation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Operation) XXX_Merge

func (m *Operation) XXX_Merge(src proto.Message)

func (*Operation) XXX_Size

func (m *Operation) XXX_Size() int

func (*Operation) XXX_Unmarshal

func (m *Operation) XXX_Unmarshal(b []byte) error

type Operation_Type

type Operation_Type int32
const (
	Operation_SET    Operation_Type = 0
	Operation_DELETE Operation_Type = 1
)

func (Operation_Type) EnumDescriptor

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

func (Operation_Type) String

func (x Operation_Type) String() string

type Stats

type Stats struct {
	Data                 map[string]string `` /* 149-byte string literal not displayed */
	TimeAt               int64             `protobuf:"varint,2,opt,name=time_at,json=timeAt,proto3" json:"time_at,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func NewPopulatedStats

func NewPopulatedStats(r randyDefs, easy bool) *Stats

func (*Stats) Descriptor

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

func (*Stats) Equal

func (this *Stats) Equal(that interface{}) bool

func (*Stats) GetData

func (m *Stats) GetData() map[string]string

func (*Stats) GetTimeAt

func (m *Stats) GetTimeAt() int64

func (*Stats) ProtoMessage

func (*Stats) ProtoMessage()

func (*Stats) Reset

func (m *Stats) Reset()

func (*Stats) String

func (m *Stats) String() string

func (*Stats) XXX_DiscardUnknown

func (m *Stats) XXX_DiscardUnknown()

func (*Stats) XXX_Marshal

func (m *Stats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Stats) XXX_Merge

func (m *Stats) XXX_Merge(src proto.Message)

func (*Stats) XXX_Size

func (m *Stats) XXX_Size() int

func (*Stats) XXX_Unmarshal

func (m *Stats) XXX_Unmarshal(b []byte) error

type UnimplementedDBServer

type UnimplementedDBServer struct {
}

UnimplementedDBServer can be embedded to have forward compatible implementations.

func (*UnimplementedDBServer) BatchWrite

func (*UnimplementedDBServer) BatchWrite(ctx context.Context, req *Batch) (*Nothing, error)

func (*UnimplementedDBServer) BatchWriteSync

func (*UnimplementedDBServer) BatchWriteSync(ctx context.Context, req *Batch) (*Nothing, error)

func (*UnimplementedDBServer) Delete

func (*UnimplementedDBServer) Delete(ctx context.Context, req *Entity) (*Nothing, error)

func (*UnimplementedDBServer) DeleteSync

func (*UnimplementedDBServer) DeleteSync(ctx context.Context, req *Entity) (*Nothing, error)

func (*UnimplementedDBServer) Get

func (*UnimplementedDBServer) GetStream

func (*UnimplementedDBServer) Has

func (*UnimplementedDBServer) Init

func (*UnimplementedDBServer) Init(ctx context.Context, req *Init) (*Entity, error)

func (*UnimplementedDBServer) Iterator

func (*UnimplementedDBServer) Iterator(req *Entity, srv DB_IteratorServer) error

func (*UnimplementedDBServer) ReverseIterator

func (*UnimplementedDBServer) ReverseIterator(req *Entity, srv DB_ReverseIteratorServer) error

func (*UnimplementedDBServer) Set

func (*UnimplementedDBServer) SetSync

func (*UnimplementedDBServer) SetSync(ctx context.Context, req *Entity) (*Nothing, error)

func (*UnimplementedDBServer) Stats

func (*UnimplementedDBServer) Stats(ctx context.Context, req *Nothing) (*Stats, error)

Jump to

Keyboard shortcuts

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