Documentation ¶
Index ¶
- type Client
- func (c *Client) SyncCreateResource(ctx context.Context, owner string, req *commands.CreateResourceRequest) (*events.ResourceCreated, error)
- func (c *Client) SyncDeleteResource(ctx context.Context, owner string, req *commands.DeleteResourceRequest) (*events.ResourceDeleted, error)
- func (c *Client) SyncRetrieveResource(ctx context.Context, owner string, req *commands.RetrieveResourceRequest) (*events.ResourceRetrieved, error)
- func (c *Client) SyncUpdateDeviceMetadata(ctx context.Context, owner string, req *commands.UpdateDeviceMetadataRequest) (*events.DeviceMetadataUpdated, error)
- func (c *Client) SyncUpdateResource(ctx context.Context, owner string, req *commands.UpdateResourceRequest) (*events.ResourceUpdated, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { service.ResourceAggregateClient // contains filtered or unexported fields }
func New ¶
func New(cc grpc.ClientConnInterface, subscriber eventbus.Subscriber) *Client
func (*Client) SyncCreateResource ¶
func (c *Client) SyncCreateResource(ctx context.Context, owner string, req *commands.CreateResourceRequest) (*events.ResourceCreated, error)
SyncCreateResource sends create resource command to resource aggregate and wait for resource created event from eventbus.
func (*Client) SyncDeleteResource ¶
func (c *Client) SyncDeleteResource(ctx context.Context, owner string, req *commands.DeleteResourceRequest) (*events.ResourceDeleted, error)
SyncDeleteResource sends delete resource command to resource aggregate and wait for resource deleted event from eventbus.
func (*Client) SyncRetrieveResource ¶
func (c *Client) SyncRetrieveResource(ctx context.Context, owner string, req *commands.RetrieveResourceRequest) (*events.ResourceRetrieved, error)
SyncRetrieveResource sends retrieve resource command to resource aggregate and wait for resource retrieved event from eventbus.
func (*Client) SyncUpdateDeviceMetadata ¶
func (c *Client) SyncUpdateDeviceMetadata(ctx context.Context, owner string, req *commands.UpdateDeviceMetadataRequest) (*events.DeviceMetadataUpdated, error)
SyncUpdateDeviceMetadata sends update device metadata command to resource aggregate and wait for metadata updated event from eventbus.
func (*Client) SyncUpdateResource ¶
func (c *Client) SyncUpdateResource(ctx context.Context, owner string, req *commands.UpdateResourceRequest) (*events.ResourceUpdated, error)
SyncUpdateResource sends update resource command to resource aggregate and wait for resource updated event from eventbus.