Documentation ¶
Index ¶
- type CacheClient
- type ClientSet
- type EntityClient
- func (c *EntityClient) Close() error
- func (c *EntityClient) Del(ctx context.Context, in *stategate.EntityRef) error
- func (c *EntityClient) Edit(ctx context.Context, in *stategate.Entity) (*stategate.Entity, error)
- func (c *EntityClient) Get(ctx context.Context, in *stategate.EntityRef) (*stategate.Entity, error)
- func (c *EntityClient) Revert(ctx context.Context, in *stategate.EventRef) (*stategate.Entity, error)
- func (c *EntityClient) Search(ctx context.Context, in *stategate.SearchEntityOpts) (*stategate.Entities, error)
- func (c *EntityClient) Set(ctx context.Context, in *stategate.Entity) error
- type EventClient
- func (c *EventClient) Close() error
- func (c *EventClient) Get(ctx context.Context, in *stategate.EventRef) (*stategate.Event, error)
- func (c *EventClient) Search(ctx context.Context, in *stategate.SearchEventOpts) (*stategate.Events, error)
- func (c *EventClient) Stream(ctx context.Context, in *stategate.StreamEventOpts, ...) error
- type MutexClient
- type Opt
- type Options
- type PeerClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheClient ¶ added in v0.9.0
type CacheClient struct {
// contains filtered or unexported fields
}
CacheClient is a stategate CacheService gRPC client
func NewCacheClient ¶ added in v0.9.0
NewCacheClient creates a new stategate CacheService client
func (*CacheClient) Close ¶ added in v0.9.0
func (c *CacheClient) Close() error
Close closes the gRPC client connection
type ClientSet ¶ added in v0.8.0
type ClientSet struct {
// contains filtered or unexported fields
}
ClientSet holds an EntityClient, EventClient, and PeerClient
func NewClientSet ¶ added in v0.8.0
NewClientSet returns an initialized ClientSet
func (*ClientSet) Cache ¶ added in v0.9.0
func (c *ClientSet) Cache() *CacheClient
Cache returns the clientset's CacheService client
func (*ClientSet) Entity ¶ added in v0.8.0
func (c *ClientSet) Entity() *EntityClient
Entity returns the clientset's EntityService client
func (*ClientSet) Event ¶ added in v0.8.0
func (c *ClientSet) Event() *EventClient
Event returns the clientset's EventService client
func (*ClientSet) Mutex ¶ added in v0.9.0
func (c *ClientSet) Mutex() *MutexClient
Mutex returns the clientset's MutexService client
func (*ClientSet) Peer ¶ added in v0.8.0
func (c *ClientSet) Peer() *PeerClient
Peer returns the clientset's PeerService client
type EntityClient ¶ added in v0.6.0
type EntityClient struct {
// contains filtered or unexported fields
}
EntityClient is a stategate EntityService gRPC client
func NewEntityClient ¶ added in v0.6.0
NewEntityClient creates a new stategate EntityService client
func (*EntityClient) Close ¶ added in v0.6.0
func (c *EntityClient) Close() error
Close closes the gRPC client connection
func (*EntityClient) Edit ¶ added in v0.6.1
Edit overwrites the k/v pairs present in the entity request without replacing the entire entity. It then adds the state change to the event log, then broadcast the event to all interested consumers(EventService.Stream)
func (*EntityClient) Revert ¶ added in v0.6.2
func (c *EntityClient) Revert(ctx context.Context, in *stategate.EventRef) (*stategate.Entity, error)
Revert reverts an Entity to a previous version of itself
func (*EntityClient) Search ¶ added in v0.6.0
func (c *EntityClient) Search(ctx context.Context, in *stategate.SearchEntityOpts) (*stategate.Entities, error)
Search queries the current state of entities
type EventClient ¶ added in v0.4.0
type EventClient struct {
// contains filtered or unexported fields
}
EventClient is a stategate EventService gRPC client
func NewEventClient ¶ added in v0.4.0
NewEventClient creates a new stategate EventService client EntityService serves API methods to clients that modify/query the current state of an entity An Entity is a single object with a type, domain, key, and k/v values
func (*EventClient) Close ¶ added in v0.4.0
func (c *EventClient) Close() error
Close closes the gRPC client connection
func (*EventClient) Search ¶ added in v0.4.0
func (c *EventClient) Search(ctx context.Context, in *stategate.SearchEventOpts) (*stategate.Events, error)
Search queries historical events(changes to entities).
func (*EventClient) Stream ¶ added in v0.4.0
func (c *EventClient) Stream(ctx context.Context, in *stategate.StreamEventOpts, fn func(even *stategate.Event) bool) error
Stream creates an event stream/subscription to changes to entities until fn returns false OR the context cancels.. Glob matching is supported.
type MutexClient ¶ added in v0.9.0
type MutexClient struct {
// contains filtered or unexported fields
}
MutexClient is a stategate MutexService gRPC client
func NewMutexClient ¶ added in v0.9.0
NewMutexClient creates a new stategate MutexService client
func (*MutexClient) Close ¶ added in v0.9.0
func (c *MutexClient) Close() error
Close closes the gRPC client connection
type Opt ¶
type Opt func(o *Options)
Opt is a single configuration option
func WithIDToken ¶
WithIDToken makes the client use the oauth id token(if it exists) instead of the oauth access token
func WithLogging ¶
WithLogging registers a logging middleware
func WithTokenSource ¶
func WithTokenSource(tokenSource oauth2.TokenSource) Opt
WithTokenSource uses oauth token add an authorization header to every outbound request
func WithTransportCreds ¶
func WithTransportCreds(creds credentials.TransportCredentials) Opt
WithTransportCreds adds transport credentials to the client
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options holds configuration options
type PeerClient ¶ added in v0.8.0
type PeerClient struct {
// contains filtered or unexported fields
}
PeerClient is a stategate PeerService gRPC client
func NewPeerClient ¶ added in v0.8.0
NewPeerClient creates a new stategate PeerService client
func (PeerClient) Broadcast ¶ added in v0.8.0
Broadcast broadcasts a message to N subscribers(PeerService clients calling Stream)
func (*PeerClient) Close ¶ added in v0.8.0
func (c *PeerClient) Close() error
Close closes the gRPC client connection
func (PeerClient) Stream ¶ added in v0.8.0
func (p PeerClient) Stream(ctx context.Context, in *stategate.StreamMessageOpts, fn func(msg *stategate.PeerMessage) bool) error
Stream consumes/streams messages from message producers(PeerService clients calling broadcast)