Documentation ¶
Index ¶
- 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.StreamOpts, ...) error
- type Opt
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 state client
func (*EntityClient) Close ¶ added in v0.6.0
func (c *EntityClient) Close() error
Close closes the gRPC client connection
func (*EntityClient) Del ¶ added in v0.6.0
func (c *EntityClient) Del(ctx context.Context, in *stategate.EntityRef) error
Del deletes an application state value(k/v pairs)
func (*EntityClient) Edit ¶ added in v0.6.1
func (c *EntityClient) Edit(ctx context.Context, in *stategate.Entity) (*stategate.Entity, error)
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) Get ¶ added in v0.6.0
func (c *EntityClient) Get(ctx context.Context, in *stategate.EntityRef) (*stategate.Entity, error)
Get gets an entity's current state
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
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 EntityService 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) Get ¶ added in v0.7.0
func (c *EventClient) Get(ctx context.Context, in *stategate.EventRef) (*stategate.Event, error)
Get gets an existing Event
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.StreamOpts, 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 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