pb

package
v0.0.0-...-0e8e39a Latest Latest
Warning

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

Go to latest
Published: May 15, 2021 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Package pb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ClusterCommand_Type_name = map[int32]string{
		0:  "RESERVED",
		1:  "QUEUE_SIZE",
		2:  "QUEUE_CLEAR",
		3:  "QUEUE_OFFER",
		4:  "QUEUE_POLL",
		5:  "QUEUE_PEEK",
		6:  "DICTIONARY_SIZE",
		7:  "DICTIONARY_CLEAR",
		8:  "DICTIONARY_PUT_IF_ABSENT",
		9:  "DICTIONARY_PUT",
		10: "DICTIONARY_GET",
		11: "DICTIONARY_REMOVE",
		12: "DICTIONARY_RANGE",
		13: "MUTEX_TRY_LOCK",
		14: "MUTEX_UNLOCK",
		15: "SERVICE_PING",
		16: "MAX_INDEX",
	}
	ClusterCommand_Type_value = map[string]int32{
		"RESERVED":                 0,
		"QUEUE_SIZE":               1,
		"QUEUE_CLEAR":              2,
		"QUEUE_OFFER":              3,
		"QUEUE_POLL":               4,
		"QUEUE_PEEK":               5,
		"DICTIONARY_SIZE":          6,
		"DICTIONARY_CLEAR":         7,
		"DICTIONARY_PUT_IF_ABSENT": 8,
		"DICTIONARY_PUT":           9,
		"DICTIONARY_GET":           10,
		"DICTIONARY_REMOVE":        11,
		"DICTIONARY_RANGE":         12,
		"MUTEX_TRY_LOCK":           13,
		"MUTEX_UNLOCK":             14,
		"SERVICE_PING":             15,
		"MAX_INDEX":                16,
	}
)

Enum value maps for ClusterCommand_Type.

View Source
var File_common_proto protoreflect.FileDescriptor

Functions

func RegisterStoaHandler

func RegisterStoaHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterStoaHandler registers the http handlers for service Stoa to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterStoaHandlerClient

func RegisterStoaHandlerClient(ctx context.Context, mux *runtime.ServeMux, client StoaClient) error

RegisterStoaHandlerClient registers the http handlers for service Stoa to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "StoaClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "StoaClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "StoaClient" to call the correct interceptors.

func RegisterStoaHandlerFromEndpoint

func RegisterStoaHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterStoaHandlerFromEndpoint is same as RegisterStoaHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterStoaHandlerServer

func RegisterStoaHandlerServer(ctx context.Context, mux *runtime.ServeMux, server StoaServer) error

RegisterStoaHandlerServer registers the http handlers for service Stoa to "mux". UnaryRPC :call StoaServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterStoaHandlerFromEndpoint instead.

func RegisterStoaServer

func RegisterStoaServer(s *grpc.Server, srv StoaServer)

Types

type ClientId

type ClientId struct {
	EntityName string `protobuf:"bytes,1,opt,name=entity_name,json=entityName,proto3" json:"entity_name,omitempty"`
	Id         []byte `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	Payload    []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

ClientId contains Client ID.

func (*ClientId) Descriptor deprecated

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

Deprecated: Use ClientId.ProtoReflect.Descriptor instead.

func (*ClientId) GetEntityName

func (x *ClientId) GetEntityName() string

func (*ClientId) GetId

func (x *ClientId) GetId() []byte

func (*ClientId) GetPayload

func (x *ClientId) GetPayload() []byte

func (*ClientId) ProtoMessage

func (*ClientId) ProtoMessage()

func (*ClientId) ProtoReflect

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

func (*ClientId) Reset

func (x *ClientId) Reset()

func (*ClientId) String

func (x *ClientId) String() string

func (*ClientId) Validate

func (m *ClientId) Validate() error

Validate checks the field values on ClientId with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type ClientIdValidationError

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

ClientIdValidationError is the validation error returned by ClientId.Validate if the designated constraints aren't met.

func (ClientIdValidationError) Cause

func (e ClientIdValidationError) Cause() error

Cause function returns cause value.

func (ClientIdValidationError) Error

func (e ClientIdValidationError) Error() string

Error satisfies the builtin error interface

func (ClientIdValidationError) ErrorName

func (e ClientIdValidationError) ErrorName() string

ErrorName returns error name.

func (ClientIdValidationError) Field

func (e ClientIdValidationError) Field() string

Field function returns field value.

func (ClientIdValidationError) Key

func (e ClientIdValidationError) Key() bool

Key function returns key value.

func (ClientIdValidationError) Reason

func (e ClientIdValidationError) Reason() string

Reason function returns reason value.

type ClusterCommand

type ClusterCommand struct {
	Command        ClusterCommand_Type `protobuf:"varint,1,opt,name=command,proto3,enum=github.com.vontikov.stoa.v1.ClusterCommand_Type" json:"command,omitempty"`
	TtlEnabled     bool                `protobuf:"varint,2,opt,name=ttl_enabled,json=ttlEnabled,proto3" json:"ttl_enabled,omitempty"`
	TtlMillis      int64               `protobuf:"varint,3,opt,name=ttl_millis,json=ttlMillis,proto3" json:"ttl_millis,omitempty"`
	BarrierEnabled bool                `protobuf:"varint,4,opt,name=barrier_enabled,json=barrierEnabled,proto3" json:"barrier_enabled,omitempty"`
	BarrierMillis  int64               `protobuf:"varint,5,opt,name=barrier_millis,json=barrierMillis,proto3" json:"barrier_millis,omitempty"`
	// Types that are assignable to Payload:
	//	*ClusterCommand_Entity
	//	*ClusterCommand_Value
	//	*ClusterCommand_Key
	//	*ClusterCommand_KeyValue
	//	*ClusterCommand_ClientId
	Payload isClusterCommand_Payload `protobuf_oneof:"payload"`
	// contains filtered or unexported fields
}

ClusterCommand contains Raft claster log command.

func (*ClusterCommand) Descriptor deprecated

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

Deprecated: Use ClusterCommand.ProtoReflect.Descriptor instead.

func (*ClusterCommand) GetBarrierEnabled

func (x *ClusterCommand) GetBarrierEnabled() bool

func (*ClusterCommand) GetBarrierMillis

func (x *ClusterCommand) GetBarrierMillis() int64

func (*ClusterCommand) GetClientId

func (x *ClusterCommand) GetClientId() *ClientId

func (*ClusterCommand) GetCommand

func (x *ClusterCommand) GetCommand() ClusterCommand_Type

func (*ClusterCommand) GetEntity

func (x *ClusterCommand) GetEntity() *Entity

func (*ClusterCommand) GetKey

func (x *ClusterCommand) GetKey() *Key

func (*ClusterCommand) GetKeyValue

func (x *ClusterCommand) GetKeyValue() *KeyValue

func (*ClusterCommand) GetPayload

func (m *ClusterCommand) GetPayload() isClusterCommand_Payload

func (*ClusterCommand) GetTtlEnabled

func (x *ClusterCommand) GetTtlEnabled() bool

func (*ClusterCommand) GetTtlMillis

func (x *ClusterCommand) GetTtlMillis() int64

func (*ClusterCommand) GetValue

func (x *ClusterCommand) GetValue() *Value

func (*ClusterCommand) ProtoMessage

func (*ClusterCommand) ProtoMessage()

func (*ClusterCommand) ProtoReflect

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

func (*ClusterCommand) Reset

func (x *ClusterCommand) Reset()

func (*ClusterCommand) String

func (x *ClusterCommand) String() string

func (*ClusterCommand) Validate

func (m *ClusterCommand) Validate() error

Validate checks the field values on ClusterCommand with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type ClusterCommandValidationError

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

ClusterCommandValidationError is the validation error returned by ClusterCommand.Validate if the designated constraints aren't met.

func (ClusterCommandValidationError) Cause

Cause function returns cause value.

func (ClusterCommandValidationError) Error

Error satisfies the builtin error interface

func (ClusterCommandValidationError) ErrorName

func (e ClusterCommandValidationError) ErrorName() string

ErrorName returns error name.

func (ClusterCommandValidationError) Field

Field function returns field value.

func (ClusterCommandValidationError) Key

Key function returns key value.

func (ClusterCommandValidationError) Reason

Reason function returns reason value.

type ClusterCommand_ClientId

type ClusterCommand_ClientId struct {
	ClientId *ClientId `protobuf:"bytes,10,opt,name=client_id,json=clientId,proto3,oneof"`
}

type ClusterCommand_Entity

type ClusterCommand_Entity struct {
	Entity *Entity `protobuf:"bytes,6,opt,name=entity,proto3,oneof"`
}

type ClusterCommand_Key

type ClusterCommand_Key struct {
	Key *Key `protobuf:"bytes,8,opt,name=key,proto3,oneof"`
}

type ClusterCommand_KeyValue

type ClusterCommand_KeyValue struct {
	KeyValue *KeyValue `protobuf:"bytes,9,opt,name=key_value,json=keyValue,proto3,oneof"`
}

type ClusterCommand_Type

type ClusterCommand_Type int32

Type is a Raft claster command type.

const (
	ClusterCommand_RESERVED                 ClusterCommand_Type = 0
	ClusterCommand_QUEUE_SIZE               ClusterCommand_Type = 1
	ClusterCommand_QUEUE_CLEAR              ClusterCommand_Type = 2
	ClusterCommand_QUEUE_OFFER              ClusterCommand_Type = 3
	ClusterCommand_QUEUE_POLL               ClusterCommand_Type = 4
	ClusterCommand_QUEUE_PEEK               ClusterCommand_Type = 5
	ClusterCommand_DICTIONARY_SIZE          ClusterCommand_Type = 6
	ClusterCommand_DICTIONARY_CLEAR         ClusterCommand_Type = 7
	ClusterCommand_DICTIONARY_PUT_IF_ABSENT ClusterCommand_Type = 8
	ClusterCommand_DICTIONARY_PUT           ClusterCommand_Type = 9
	ClusterCommand_DICTIONARY_GET           ClusterCommand_Type = 10
	ClusterCommand_DICTIONARY_REMOVE        ClusterCommand_Type = 11
	ClusterCommand_DICTIONARY_RANGE         ClusterCommand_Type = 12
	ClusterCommand_MUTEX_TRY_LOCK           ClusterCommand_Type = 13
	ClusterCommand_MUTEX_UNLOCK             ClusterCommand_Type = 14
	ClusterCommand_SERVICE_PING             ClusterCommand_Type = 15
	ClusterCommand_MAX_INDEX                ClusterCommand_Type = 16
)

func (ClusterCommand_Type) Descriptor

func (ClusterCommand_Type) Enum

func (ClusterCommand_Type) EnumDescriptor deprecated

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

Deprecated: Use ClusterCommand_Type.Descriptor instead.

func (ClusterCommand_Type) Number

func (ClusterCommand_Type) String

func (x ClusterCommand_Type) String() string

func (ClusterCommand_Type) Type

type ClusterCommand_Value

type ClusterCommand_Value struct {
	Value *Value `protobuf:"bytes,7,opt,name=value,proto3,oneof"`
}

type Discovery

type Discovery struct {
	Id       string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`                              // Peer ID
	BindIp   string `protobuf:"bytes,2,opt,name=bind_ip,json=bindIp,proto3" json:"bind_ip,omitempty"`        // bind IP
	BindPort int32  `protobuf:"varint,3,opt,name=bind_port,json=bindPort,proto3" json:"bind_port,omitempty"` // bind port
	GrpcIp   string `protobuf:"bytes,4,opt,name=grpc_ip,json=grpcIp,proto3" json:"grpc_ip,omitempty"`        // gRPC IP
	GrpcPort int32  `protobuf:"varint,5,opt,name=grpc_port,json=grpcPort,proto3" json:"grpc_port,omitempty"` // gRPC port
	Leader   bool   `protobuf:"varint,6,opt,name=leader,proto3" json:"leader,omitempty"`                     // leader status
	// contains filtered or unexported fields
}

Discovery contains Raft Peer information.

func (*Discovery) Descriptor deprecated

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

Deprecated: Use Discovery.ProtoReflect.Descriptor instead.

func (*Discovery) GetBindIp

func (x *Discovery) GetBindIp() string

func (*Discovery) GetBindPort

func (x *Discovery) GetBindPort() int32

func (*Discovery) GetGrpcIp

func (x *Discovery) GetGrpcIp() string

func (*Discovery) GetGrpcPort

func (x *Discovery) GetGrpcPort() int32

func (*Discovery) GetId

func (x *Discovery) GetId() string

func (*Discovery) GetLeader

func (x *Discovery) GetLeader() bool

func (*Discovery) ProtoMessage

func (*Discovery) ProtoMessage()

func (*Discovery) ProtoReflect

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

func (*Discovery) Reset

func (x *Discovery) Reset()

func (*Discovery) String

func (x *Discovery) String() string

func (*Discovery) Validate

func (m *Discovery) Validate() error

Validate checks the field values on Discovery with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type DiscoveryValidationError

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

DiscoveryValidationError is the validation error returned by Discovery.Validate if the designated constraints aren't met.

func (DiscoveryValidationError) Cause

func (e DiscoveryValidationError) Cause() error

Cause function returns cause value.

func (DiscoveryValidationError) Error

func (e DiscoveryValidationError) Error() string

Error satisfies the builtin error interface

func (DiscoveryValidationError) ErrorName

func (e DiscoveryValidationError) ErrorName() string

ErrorName returns error name.

func (DiscoveryValidationError) Field

func (e DiscoveryValidationError) Field() string

Field function returns field value.

func (DiscoveryValidationError) Key

Key function returns key value.

func (DiscoveryValidationError) Reason

func (e DiscoveryValidationError) Reason() string

Reason function returns reason value.

type Empty

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

Empty contains no data.

func (*Empty) Descriptor deprecated

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

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

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

func (*Empty) Validate

func (m *Empty) Validate() error

Validate checks the field values on Empty with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type EmptyValidationError

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

EmptyValidationError is the validation error returned by Empty.Validate if the designated constraints aren't met.

func (EmptyValidationError) Cause

func (e EmptyValidationError) Cause() error

Cause function returns cause value.

func (EmptyValidationError) Error

func (e EmptyValidationError) Error() string

Error satisfies the builtin error interface

func (EmptyValidationError) ErrorName

func (e EmptyValidationError) ErrorName() string

ErrorName returns error name.

func (EmptyValidationError) Field

func (e EmptyValidationError) Field() string

Field function returns field value.

func (EmptyValidationError) Key

func (e EmptyValidationError) Key() bool

Key function returns key value.

func (EmptyValidationError) Reason

func (e EmptyValidationError) Reason() string

Reason function returns reason value.

type Entity

type Entity struct {
	EntityName string `protobuf:"bytes,1,opt,name=entity_name,json=entityName,proto3" json:"entity_name,omitempty"`
	// contains filtered or unexported fields
}

Entity is a Stoa entity.

func (*Entity) Descriptor deprecated

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

Deprecated: Use Entity.ProtoReflect.Descriptor instead.

func (*Entity) GetEntityName

func (x *Entity) GetEntityName() string

func (*Entity) ProtoMessage

func (*Entity) ProtoMessage()

func (*Entity) ProtoReflect

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

func (*Entity) Reset

func (x *Entity) Reset()

func (*Entity) String

func (x *Entity) String() string

func (*Entity) Validate

func (m *Entity) Validate() error

Validate checks the field values on Entity with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type EntityValidationError

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

EntityValidationError is the validation error returned by Entity.Validate if the designated constraints aren't met.

func (EntityValidationError) Cause

func (e EntityValidationError) Cause() error

Cause function returns cause value.

func (EntityValidationError) Error

func (e EntityValidationError) Error() string

Error satisfies the builtin error interface

func (EntityValidationError) ErrorName

func (e EntityValidationError) ErrorName() string

ErrorName returns error name.

func (EntityValidationError) Field

func (e EntityValidationError) Field() string

Field function returns field value.

func (EntityValidationError) Key

func (e EntityValidationError) Key() bool

Key function returns key value.

func (EntityValidationError) Reason

func (e EntityValidationError) Reason() string

Reason function returns reason value.

type Key

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

Key contains Dictionary key.

func (*Key) Descriptor deprecated

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

Deprecated: Use Key.ProtoReflect.Descriptor instead.

func (*Key) GetEntityName

func (x *Key) GetEntityName() string

func (*Key) GetKey

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

func (*Key) ProtoMessage

func (*Key) ProtoMessage()

func (*Key) ProtoReflect

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

func (*Key) Reset

func (x *Key) Reset()

func (*Key) String

func (x *Key) String() string

func (*Key) Validate

func (m *Key) Validate() error

Validate checks the field values on Key with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type KeyValidationError

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

KeyValidationError is the validation error returned by Key.Validate if the designated constraints aren't met.

func (KeyValidationError) Cause

func (e KeyValidationError) Cause() error

Cause function returns cause value.

func (KeyValidationError) Error

func (e KeyValidationError) Error() string

Error satisfies the builtin error interface

func (KeyValidationError) ErrorName

func (e KeyValidationError) ErrorName() string

ErrorName returns error name.

func (KeyValidationError) Field

func (e KeyValidationError) Field() string

Field function returns field value.

func (KeyValidationError) Key

func (e KeyValidationError) Key() bool

Key function returns key value.

func (KeyValidationError) Reason

func (e KeyValidationError) Reason() string

Reason function returns reason value.

type KeyValue

type KeyValue struct {
	EntityName string `protobuf:"bytes,1,opt,name=entity_name,json=entityName,proto3" json:"entity_name,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"`
	// contains filtered or unexported fields
}

KeyValue contains Dictionary key-value pair.

func (*KeyValue) Descriptor deprecated

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

Deprecated: Use KeyValue.ProtoReflect.Descriptor instead.

func (*KeyValue) GetEntityName

func (x *KeyValue) GetEntityName() string

func (*KeyValue) GetKey

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

func (*KeyValue) GetValue

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

func (*KeyValue) ProtoMessage

func (*KeyValue) ProtoMessage()

func (*KeyValue) ProtoReflect

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

func (*KeyValue) Reset

func (x *KeyValue) Reset()

func (*KeyValue) String

func (x *KeyValue) String() string

func (*KeyValue) Validate

func (m *KeyValue) Validate() error

Validate checks the field values on KeyValue with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type KeyValueValidationError

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

KeyValueValidationError is the validation error returned by KeyValue.Validate if the designated constraints aren't met.

func (KeyValueValidationError) Cause

func (e KeyValueValidationError) Cause() error

Cause function returns cause value.

func (KeyValueValidationError) Error

func (e KeyValueValidationError) Error() string

Error satisfies the builtin error interface

func (KeyValueValidationError) ErrorName

func (e KeyValueValidationError) ErrorName() string

ErrorName returns error name.

func (KeyValueValidationError) Field

func (e KeyValueValidationError) Field() string

Field function returns field value.

func (KeyValueValidationError) Key

func (e KeyValueValidationError) Key() bool

Key function returns key value.

func (KeyValueValidationError) Reason

func (e KeyValueValidationError) Reason() string

Reason function returns reason value.

type Result

type Result struct {
	Ok      bool   `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
	Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

Result contains an operation result.

func (*Result) Descriptor deprecated

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

Deprecated: Use Result.ProtoReflect.Descriptor instead.

func (*Result) GetOk

func (x *Result) GetOk() bool

func (*Result) GetPayload

func (x *Result) GetPayload() []byte

func (*Result) ProtoMessage

func (*Result) ProtoMessage()

func (*Result) ProtoReflect

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

func (*Result) Reset

func (x *Result) Reset()

func (*Result) String

func (x *Result) String() string

func (*Result) Validate

func (m *Result) Validate() error

Validate checks the field values on Result with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type ResultValidationError

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

ResultValidationError is the validation error returned by Result.Validate if the designated constraints aren't met.

func (ResultValidationError) Cause

func (e ResultValidationError) Cause() error

Cause function returns cause value.

func (ResultValidationError) Error

func (e ResultValidationError) Error() string

Error satisfies the builtin error interface

func (ResultValidationError) ErrorName

func (e ResultValidationError) ErrorName() string

ErrorName returns error name.

func (ResultValidationError) Field

func (e ResultValidationError) Field() string

Field function returns field value.

func (ResultValidationError) Key

func (e ResultValidationError) Key() bool

Key function returns key value.

func (ResultValidationError) Reason

func (e ResultValidationError) Reason() string

Reason function returns reason value.

type StoaClient

type StoaClient interface {
	// QueueSize returns size of the Queue.
	QueueSize(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Value, error)
	// QueueClear cleares the Queue.
	QueueClear(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Empty, error)
	// QueueOffer offers the Value to the Queue.
	QueueOffer(ctx context.Context, in *Value, opts ...grpc.CallOption) (*Result, error)
	// QueuePoll removes and returns the head of the Queue.
	QueuePoll(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Value, error)
	// QueuePeek returns the head of the Queue.
	QueuePeek(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Value, error)
	// DictionarySize returns size of the Dictionary.
	DictionarySize(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Value, error)
	// DictionaryClear clears the Dictionary.
	DictionaryClear(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Empty, error)
	// DictionaryPutIfAbsent puts into the Dictionary the KeyValue if the key is
	// not present.
	DictionaryPutIfAbsent(ctx context.Context, in *KeyValue, opts ...grpc.CallOption) (*Result, error)
	// DictionaryPut puts into the Dictionary the KeyValue and returns the old
	// Value.
	DictionaryPut(ctx context.Context, in *KeyValue, opts ...grpc.CallOption) (*Value, error)
	// DictionaryGet returns from the Dictionary the Value specified by the Key.
	DictionaryGet(ctx context.Context, in *Key, opts ...grpc.CallOption) (*Value, error)
	// DictionaryRemove removes from the Dictionary the key-value pair specified
	// by the Key.
	DictionaryRemove(ctx context.Context, in *Key, opts ...grpc.CallOption) (*Result, error)
	// DictionaryRange returns from the Dictionary all the key-value pairs.
	DictionaryRange(ctx context.Context, in *Entity, opts ...grpc.CallOption) (Stoa_DictionaryRangeClient, error)
	// MutexTryLock tries to lock the Mutex.
	MutexTryLock(ctx context.Context, in *ClientId, opts ...grpc.CallOption) (*Result, error)
	// MutexUnlock unlocks the Mutex.
	MutexUnlock(ctx context.Context, in *ClientId, opts ...grpc.CallOption) (*Result, error)
	// Ping pings the Cluster.
	Ping(ctx context.Context, in *ClientId, opts ...grpc.CallOption) (*Empty, error)
}

StoaClient is the client API for Stoa 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 NewStoaClient

func NewStoaClient(cc grpc.ClientConnInterface) StoaClient

type StoaServer

type StoaServer interface {
	// QueueSize returns size of the Queue.
	QueueSize(context.Context, *Entity) (*Value, error)
	// QueueClear cleares the Queue.
	QueueClear(context.Context, *Entity) (*Empty, error)
	// QueueOffer offers the Value to the Queue.
	QueueOffer(context.Context, *Value) (*Result, error)
	// QueuePoll removes and returns the head of the Queue.
	QueuePoll(context.Context, *Entity) (*Value, error)
	// QueuePeek returns the head of the Queue.
	QueuePeek(context.Context, *Entity) (*Value, error)
	// DictionarySize returns size of the Dictionary.
	DictionarySize(context.Context, *Entity) (*Value, error)
	// DictionaryClear clears the Dictionary.
	DictionaryClear(context.Context, *Entity) (*Empty, error)
	// DictionaryPutIfAbsent puts into the Dictionary the KeyValue if the key is
	// not present.
	DictionaryPutIfAbsent(context.Context, *KeyValue) (*Result, error)
	// DictionaryPut puts into the Dictionary the KeyValue and returns the old
	// Value.
	DictionaryPut(context.Context, *KeyValue) (*Value, error)
	// DictionaryGet returns from the Dictionary the Value specified by the Key.
	DictionaryGet(context.Context, *Key) (*Value, error)
	// DictionaryRemove removes from the Dictionary the key-value pair specified
	// by the Key.
	DictionaryRemove(context.Context, *Key) (*Result, error)
	// DictionaryRange returns from the Dictionary all the key-value pairs.
	DictionaryRange(*Entity, Stoa_DictionaryRangeServer) error
	// MutexTryLock tries to lock the Mutex.
	MutexTryLock(context.Context, *ClientId) (*Result, error)
	// MutexUnlock unlocks the Mutex.
	MutexUnlock(context.Context, *ClientId) (*Result, error)
	// Ping pings the Cluster.
	Ping(context.Context, *ClientId) (*Empty, error)
	// contains filtered or unexported methods
}

StoaServer is the server API for Stoa service. All implementations must embed UnimplementedStoaServer for forward compatibility

type Stoa_DictionaryRangeClient

type Stoa_DictionaryRangeClient interface {
	Recv() (*KeyValue, error)
	grpc.ClientStream
}

type Stoa_DictionaryRangeServer

type Stoa_DictionaryRangeServer interface {
	Send(*KeyValue) error
	grpc.ServerStream
}

type UnimplementedStoaServer

type UnimplementedStoaServer struct {
}

UnimplementedStoaServer must be embedded to have forward compatible implementations.

func (UnimplementedStoaServer) DictionaryClear

func (UnimplementedStoaServer) DictionaryClear(context.Context, *Entity) (*Empty, error)

func (UnimplementedStoaServer) DictionaryGet

func (UnimplementedStoaServer) DictionaryGet(context.Context, *Key) (*Value, error)

func (UnimplementedStoaServer) DictionaryPut

func (UnimplementedStoaServer) DictionaryPutIfAbsent

func (UnimplementedStoaServer) DictionaryPutIfAbsent(context.Context, *KeyValue) (*Result, error)

func (UnimplementedStoaServer) DictionaryRange

func (UnimplementedStoaServer) DictionaryRemove

func (UnimplementedStoaServer) DictionaryRemove(context.Context, *Key) (*Result, error)

func (UnimplementedStoaServer) DictionarySize

func (UnimplementedStoaServer) DictionarySize(context.Context, *Entity) (*Value, error)

func (UnimplementedStoaServer) MutexTryLock

func (UnimplementedStoaServer) MutexUnlock

func (UnimplementedStoaServer) Ping

func (UnimplementedStoaServer) QueueClear

func (UnimplementedStoaServer) QueueOffer

func (UnimplementedStoaServer) QueuePeek

func (UnimplementedStoaServer) QueuePoll

func (UnimplementedStoaServer) QueueSize

type UnsafeStoaServer

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

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

type Value

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

Value contains an arbitrary data.

func (*Value) Descriptor deprecated

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

Deprecated: Use Value.ProtoReflect.Descriptor instead.

func (*Value) GetEntityName

func (x *Value) GetEntityName() string

func (*Value) GetValue

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

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

func (*Value) Validate

func (m *Value) Validate() error

Validate checks the field values on Value with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type ValueValidationError

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

ValueValidationError is the validation error returned by Value.Validate if the designated constraints aren't met.

func (ValueValidationError) Cause

func (e ValueValidationError) Cause() error

Cause function returns cause value.

func (ValueValidationError) Error

func (e ValueValidationError) Error() string

Error satisfies the builtin error interface

func (ValueValidationError) ErrorName

func (e ValueValidationError) ErrorName() string

ErrorName returns error name.

func (ValueValidationError) Field

func (e ValueValidationError) Field() string

Field function returns field value.

func (ValueValidationError) Key

func (e ValueValidationError) Key() bool

Key function returns key value.

func (ValueValidationError) Reason

func (e ValueValidationError) Reason() string

Reason function returns reason value.

Jump to

Keyboard shortcuts

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