store_v1

package
v0.0.0-...-fe9e4bd Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Action_Type_name = map[int32]string{
		0: "STORE_GET",
		1: "STORE_POST",
		2: "STORE_DELETE",
	}
	Action_Type_value = map[string]int32{
		"STORE_GET":    0,
		"STORE_POST":   1,
		"STORE_DELETE": 2,
	}
)

Enum value maps for Action_Type.

View Source
var File_api_v1_store_proto protoreflect.FileDescriptor
View Source
var Store_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "store.v1.Store",
	HandlerType: (*StoreServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Produce",
			Handler:    _Store_Produce_Handler,
		},
		{
			MethodName: "Consume",
			Handler:    _Store_Consume_Handler,
		},
		{
			MethodName: "ConsumeWithKey",
			Handler:    _Store_ConsumeWithKey_Handler,
		},
		{
			MethodName: "AllKeysAndValues",
			Handler:    _Store_AllKeysAndValues_Handler,
		},
		{
			MethodName: "PrefixConsume",
			Handler:    _Store_PrefixConsume_Handler,
		},
		{
			MethodName: "GetServers",
			Handler:    _Store_GetServers_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ProduceStream",
			Handler:       _Store_ProduceStream_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "ConsumeStream",
			Handler:       _Store_ConsumeStream_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "ConsumeStreamWithKey",
			Handler:       _Store_ConsumeStreamWithKey_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "api/v1/store.proto",
}

Store_ServiceDesc is the grpc.ServiceDesc for Store service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterStoreServer

func RegisterStoreServer(s grpc.ServiceRegistrar, srv StoreServer)

Types

type Action

type Action struct {
	Type       Action_Type `protobuf:"varint,1,opt,name=type,proto3,enum=store.v1.Action_Type" json:"type,omitempty"`
	Submessage []byte      `protobuf:"bytes,2,opt,name=submessage,proto3" json:"submessage,omitempty"`
	// contains filtered or unexported fields
}

func (*Action) Descriptor deprecated

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

Deprecated: Use Action.ProtoReflect.Descriptor instead.

func (*Action) GetSubmessage

func (x *Action) GetSubmessage() []byte

func (*Action) GetType

func (x *Action) GetType() Action_Type

func (*Action) ProtoMessage

func (*Action) ProtoMessage()

func (*Action) ProtoReflect

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

func (*Action) Reset

func (x *Action) Reset()

func (*Action) String

func (x *Action) String() string

type Action_Type

type Action_Type int32
const (
	Action_STORE_GET    Action_Type = 0
	Action_STORE_POST   Action_Type = 1
	Action_STORE_DELETE Action_Type = 2
)

func (Action_Type) Descriptor

func (Action_Type) Enum

func (x Action_Type) Enum() *Action_Type

func (Action_Type) EnumDescriptor deprecated

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

Deprecated: Use Action_Type.Descriptor instead.

func (Action_Type) Number

func (x Action_Type) Number() protoreflect.EnumNumber

func (Action_Type) String

func (x Action_Type) String() string

func (Action_Type) Type

type ConsumeRequest

type ConsumeRequest struct {
	Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

func (*ConsumeRequest) Descriptor deprecated

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

Deprecated: Use ConsumeRequest.ProtoReflect.Descriptor instead.

func (*ConsumeRequest) GetKey

func (x *ConsumeRequest) GetKey() []byte

func (*ConsumeRequest) ProtoMessage

func (*ConsumeRequest) ProtoMessage()

func (*ConsumeRequest) ProtoReflect

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

func (*ConsumeRequest) Reset

func (x *ConsumeRequest) Reset()

func (*ConsumeRequest) String

func (x *ConsumeRequest) String() string

type ConsumeResponse

type ConsumeResponse struct {
	Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*ConsumeResponse) Descriptor deprecated

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

Deprecated: Use ConsumeResponse.ProtoReflect.Descriptor instead.

func (*ConsumeResponse) GetValue

func (x *ConsumeResponse) GetValue() []byte

func (*ConsumeResponse) ProtoMessage

func (*ConsumeResponse) ProtoMessage()

func (*ConsumeResponse) ProtoReflect

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

func (*ConsumeResponse) Reset

func (x *ConsumeResponse) Reset()

func (*ConsumeResponse) String

func (x *ConsumeResponse) String() string

type ConsumeResponseRecord

type ConsumeResponseRecord struct {
	Record *Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"`
	// contains filtered or unexported fields
}

func (*ConsumeResponseRecord) Descriptor deprecated

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

Deprecated: Use ConsumeResponseRecord.ProtoReflect.Descriptor instead.

func (*ConsumeResponseRecord) GetRecord

func (x *ConsumeResponseRecord) GetRecord() *Record

func (*ConsumeResponseRecord) ProtoMessage

func (*ConsumeResponseRecord) ProtoMessage()

func (*ConsumeResponseRecord) ProtoReflect

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

func (*ConsumeResponseRecord) Reset

func (x *ConsumeResponseRecord) Reset()

func (*ConsumeResponseRecord) String

func (x *ConsumeResponseRecord) String() string

type ErrKeyNotFound

type ErrKeyNotFound struct {
	Key []byte
}

func (ErrKeyNotFound) Error

func (e ErrKeyNotFound) Error() string

func (ErrKeyNotFound) GRPCStatus

func (e ErrKeyNotFound) GRPCStatus() *status.Status

type GetServerRequest

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

func (*GetServerRequest) Descriptor deprecated

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

Deprecated: Use GetServerRequest.ProtoReflect.Descriptor instead.

func (*GetServerRequest) ProtoMessage

func (*GetServerRequest) ProtoMessage()

func (*GetServerRequest) ProtoReflect

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

func (*GetServerRequest) Reset

func (x *GetServerRequest) Reset()

func (*GetServerRequest) String

func (x *GetServerRequest) String() string

type GetServersResponse

type GetServersResponse struct {
	Servers []*Server `protobuf:"bytes,1,rep,name=servers,proto3" json:"servers,omitempty"`
	// contains filtered or unexported fields
}

func (*GetServersResponse) Descriptor deprecated

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

Deprecated: Use GetServersResponse.ProtoReflect.Descriptor instead.

func (*GetServersResponse) GetServers

func (x *GetServersResponse) GetServers() []*Server

func (*GetServersResponse) ProtoMessage

func (*GetServersResponse) ProtoMessage()

func (*GetServersResponse) ProtoReflect

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

func (*GetServersResponse) Reset

func (x *GetServersResponse) Reset()

func (*GetServersResponse) String

func (x *GetServersResponse) String() string

type MultipleConsume

type MultipleConsume struct {
	Pairs []*Record `protobuf:"bytes,1,rep,name=pairs,proto3" json:"pairs,omitempty"`
	// contains filtered or unexported fields
}

func (*MultipleConsume) Descriptor deprecated

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

Deprecated: Use MultipleConsume.ProtoReflect.Descriptor instead.

func (*MultipleConsume) GetPairs

func (x *MultipleConsume) GetPairs() []*Record

func (*MultipleConsume) ProtoMessage

func (*MultipleConsume) ProtoMessage()

func (*MultipleConsume) ProtoReflect

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

func (*MultipleConsume) Reset

func (x *MultipleConsume) Reset()

func (*MultipleConsume) String

func (x *MultipleConsume) String() string

type Prefix

type Prefix struct {
	Prefix []byte `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"`
	// contains filtered or unexported fields
}

func (*Prefix) Descriptor deprecated

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

Deprecated: Use Prefix.ProtoReflect.Descriptor instead.

func (*Prefix) GetPrefix

func (x *Prefix) GetPrefix() []byte

func (*Prefix) ProtoMessage

func (*Prefix) ProtoMessage()

func (*Prefix) ProtoReflect

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

func (*Prefix) Reset

func (x *Prefix) Reset()

func (*Prefix) String

func (x *Prefix) String() string

type ProduceRequest

type ProduceRequest struct {
	Record *Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"`
	// contains filtered or unexported fields
}

func (*ProduceRequest) Descriptor deprecated

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

Deprecated: Use ProduceRequest.ProtoReflect.Descriptor instead.

func (*ProduceRequest) GetRecord

func (x *ProduceRequest) GetRecord() *Record

func (*ProduceRequest) ProtoMessage

func (*ProduceRequest) ProtoMessage()

func (*ProduceRequest) ProtoReflect

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

func (*ProduceRequest) Reset

func (x *ProduceRequest) Reset()

func (*ProduceRequest) String

func (x *ProduceRequest) String() string

type ProduceResponse

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

func (*ProduceResponse) Descriptor deprecated

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

Deprecated: Use ProduceResponse.ProtoReflect.Descriptor instead.

func (*ProduceResponse) ProtoMessage

func (*ProduceResponse) ProtoMessage()

func (*ProduceResponse) ProtoReflect

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

func (*ProduceResponse) Reset

func (x *ProduceResponse) Reset()

func (*ProduceResponse) String

func (x *ProduceResponse) String() string

type Record

type Record struct {
	Key   []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Record) Descriptor deprecated

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

Deprecated: Use Record.ProtoReflect.Descriptor instead.

func (*Record) GetKey

func (x *Record) GetKey() []byte

func (*Record) GetValue

func (x *Record) GetValue() []byte

func (*Record) ProtoMessage

func (*Record) ProtoMessage()

func (*Record) ProtoReflect

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

func (*Record) Reset

func (x *Record) Reset()

func (*Record) String

func (x *Record) String() string

type Server

type Server struct {
	Id       string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	RpcAddr  string `protobuf:"bytes,2,opt,name=rpc_addr,json=rpcAddr,proto3" json:"rpc_addr,omitempty"`
	IsLeader bool   `protobuf:"varint,3,opt,name=is_leader,json=isLeader,proto3" json:"is_leader,omitempty"`
	// contains filtered or unexported fields
}

func (*Server) Descriptor deprecated

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

Deprecated: Use Server.ProtoReflect.Descriptor instead.

func (*Server) GetId

func (x *Server) GetId() string

func (*Server) GetIsLeader

func (x *Server) GetIsLeader() bool

func (*Server) GetRpcAddr

func (x *Server) GetRpcAddr() string

func (*Server) ProtoMessage

func (*Server) ProtoMessage()

func (*Server) ProtoReflect

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

func (*Server) Reset

func (x *Server) Reset()

func (*Server) String

func (x *Server) String() string

type StoreClient

type StoreClient interface {
	Produce(ctx context.Context, in *ProduceRequest, opts ...grpc.CallOption) (*ProduceResponse, error)
	Consume(ctx context.Context, in *ConsumeRequest, opts ...grpc.CallOption) (*ConsumeResponse, error)
	ConsumeWithKey(ctx context.Context, in *ConsumeRequest, opts ...grpc.CallOption) (*ConsumeResponseRecord, error)
	ProduceStream(ctx context.Context, opts ...grpc.CallOption) (Store_ProduceStreamClient, error)
	AllKeysAndValues(ctx context.Context, in *StoreEmptyRequest, opts ...grpc.CallOption) (*MultipleConsume, error)
	PrefixConsume(ctx context.Context, in *Prefix, opts ...grpc.CallOption) (*MultipleConsume, error)
	// This is really bad XD
	ConsumeStream(ctx context.Context, in *StoreEmptyRequest, opts ...grpc.CallOption) (Store_ConsumeStreamClient, error)
	ConsumeStreamWithKey(ctx context.Context, in *StoreEmptyRequest, opts ...grpc.CallOption) (Store_ConsumeStreamWithKeyClient, error)
	GetServers(ctx context.Context, in *GetServerRequest, opts ...grpc.CallOption) (*GetServersResponse, error)
}

StoreClient is the client API for Store service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewStoreClient

func NewStoreClient(cc grpc.ClientConnInterface) StoreClient

type StoreEmptyRequest

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

func (*StoreEmptyRequest) Descriptor deprecated

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

Deprecated: Use StoreEmptyRequest.ProtoReflect.Descriptor instead.

func (*StoreEmptyRequest) ProtoMessage

func (*StoreEmptyRequest) ProtoMessage()

func (*StoreEmptyRequest) ProtoReflect

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

func (*StoreEmptyRequest) Reset

func (x *StoreEmptyRequest) Reset()

func (*StoreEmptyRequest) String

func (x *StoreEmptyRequest) String() string

type StoreServer

type StoreServer interface {
	Produce(context.Context, *ProduceRequest) (*ProduceResponse, error)
	Consume(context.Context, *ConsumeRequest) (*ConsumeResponse, error)
	ConsumeWithKey(context.Context, *ConsumeRequest) (*ConsumeResponseRecord, error)
	ProduceStream(Store_ProduceStreamServer) error
	AllKeysAndValues(context.Context, *StoreEmptyRequest) (*MultipleConsume, error)
	PrefixConsume(context.Context, *Prefix) (*MultipleConsume, error)
	// This is really bad XD
	ConsumeStream(*StoreEmptyRequest, Store_ConsumeStreamServer) error
	ConsumeStreamWithKey(*StoreEmptyRequest, Store_ConsumeStreamWithKeyServer) error
	GetServers(context.Context, *GetServerRequest) (*GetServersResponse, error)
	// contains filtered or unexported methods
}

StoreServer is the server API for Store service. All implementations must embed UnimplementedStoreServer for forward compatibility

type Store_ConsumeStreamClient

type Store_ConsumeStreamClient interface {
	Recv() (*ConsumeResponse, error)
	grpc.ClientStream
}

type Store_ConsumeStreamServer

type Store_ConsumeStreamServer interface {
	Send(*ConsumeResponse) error
	grpc.ServerStream
}

type Store_ConsumeStreamWithKeyClient

type Store_ConsumeStreamWithKeyClient interface {
	Recv() (*ConsumeResponseRecord, error)
	grpc.ClientStream
}

type Store_ConsumeStreamWithKeyServer

type Store_ConsumeStreamWithKeyServer interface {
	Send(*ConsumeResponseRecord) error
	grpc.ServerStream
}

type Store_ProduceStreamClient

type Store_ProduceStreamClient interface {
	Send(*ProduceRequest) error
	Recv() (*ProduceResponse, error)
	grpc.ClientStream
}

type Store_ProduceStreamServer

type Store_ProduceStreamServer interface {
	Send(*ProduceResponse) error
	Recv() (*ProduceRequest, error)
	grpc.ServerStream
}

type UnimplementedStoreServer

type UnimplementedStoreServer struct {
}

UnimplementedStoreServer must be embedded to have forward compatible implementations.

func (UnimplementedStoreServer) AllKeysAndValues

func (UnimplementedStoreServer) Consume

func (UnimplementedStoreServer) ConsumeStream

func (UnimplementedStoreServer) ConsumeStreamWithKey

func (UnimplementedStoreServer) ConsumeWithKey

func (UnimplementedStoreServer) GetServers

func (UnimplementedStoreServer) PrefixConsume

func (UnimplementedStoreServer) Produce

func (UnimplementedStoreServer) ProduceStream

type UnsafeStoreServer

type UnsafeStoreServer interface {
	// contains filtered or unexported methods
}

UnsafeStoreServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to StoreServer will result in compilation errors.

Jump to

Keyboard shortcuts

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