Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientIFace ¶ added in v0.0.7
type ClientIFace[T proto.Message] interface { // ProcessCommand sends a command to COS and returns the resulting state as T and metadata. // The returned error can either be a gRPC error or casting error // gRPC status codes: https://grpc.github.io/grpc/core/md_doc_statuscodes.html ProcessCommand(ctx context.Context, entityID string, command proto.Message) (T, *cospb.MetaData, error) // GetState retrieves the current state as T of an entity and its metadata // The returned error can either be a gRPC error or casting error // gRPC status codes: https://grpc.github.io/grpc/core/md_doc_statuscodes.html GetState(ctx context.Context, entityID string) (T, *cospb.MetaData, error) }
ClientIFace is the interface for a cos client
type CosClient ¶
type CosClient[T proto.Message] struct { Remote cospb.ChiefOfStateServiceClient }
CosClient implements the Client interface
func NewClient ¶
func NewClient[T proto.Message](conn *grpc.ClientConn) CosClient[T]
NewClient creates a new instance of Client
func (CosClient[T]) GetState ¶
GetState retrieves the current state as T of an entity and its metadata The returned error can either be a gRPC error or casting error gRPC status codes: https://grpc.github.io/grpc/core/md_doc_statuscodes.html
func (CosClient[T]) ProcessCommand ¶
func (c CosClient[T]) ProcessCommand(ctx context.Context, entityID string, command proto.Message) (T, *cospb.MetaData, error)
ProcessCommand sends a command to COS and returns the resulting state as T and metadata. The returned error can either be a gRPC error or casting error gRPC status codes: https://grpc.github.io/grpc/core/md_doc_statuscodes.html
Click to show internal directories.
Click to hide internal directories.