Documentation ¶
Index ¶
- Constants
- type ActorStateOperation
- type BindingEvent
- type BulkStateItem
- type Client
- func NewClient() (client Client, err error)
- func NewClientWithAddress(address string) (client Client, err error)
- func NewClientWithConnection(conn *grpc.ClientConn) Client
- func NewClientWithPort(port string) (client Client, err error)
- func NewClientWithSocket(socket string) (client Client, err error)
- type ConfigurationHandleFunction
- type ConfigurationItem
- type ConfigurationOpt
- type DataContent
- type DeleteStateItem
- type ETag
- type GRPCClient
- func (c *GRPCClient) ApplyEvent(ctx context.Context, in *pb.ApplyEventRequest) (*pb.ApplyEventResponse, error)
- func (c *GRPCClient) Close()
- func (c *GRPCClient) CreateEvent(ctx context.Context, request *pb.CreateEventRequest) (*pb.CreateEventResponse, error)
- func (c *GRPCClient) DeleteBulkState(ctx context.Context, storeName string, keys []string, meta map[string]string) error
- func (c *GRPCClient) DeleteBulkStateItems(ctx context.Context, storeName string, items []*DeleteStateItem) error
- func (c *GRPCClient) DeleteEvent(ctx context.Context, request *pb.DeleteEventRequest) (*pb.DeleteEventResponse, error)
- func (c *GRPCClient) DeleteState(ctx context.Context, storeName, key string, meta map[string]string) error
- func (c *GRPCClient) DeleteStateWithETag(ctx context.Context, storeName, key string, etag *ETag, meta map[string]string, ...) error
- func (c *GRPCClient) ExecuteStateTransaction(ctx context.Context, storeName string, meta map[string]string, ...) error
- func (c *GRPCClient) GetActorState(ctx context.Context, in *GetActorStateRequest) (*GetActorStateResponse, error)
- func (c *GRPCClient) GetAppLogById(ctx context.Context, in *pb.GetAppLogByIdRequest) (*pb.GetAppLogByIdResponse, error)
- func (c *GRPCClient) GetBulkSecret(ctx context.Context, storeName string, meta map[string]string) (data map[string]map[string]string, err error)
- func (c *GRPCClient) GetBulkState(ctx context.Context, storeName string, keys []string, meta map[string]string, ...) ([]*BulkStateItem, error)
- func (c *GRPCClient) GetConfigurationItem(ctx context.Context, storeName, key string, opts ...ConfigurationOpt) (*ConfigurationItem, error)
- func (c *GRPCClient) GetConfigurationItems(ctx context.Context, storeName string, keys []string, opts ...ConfigurationOpt) ([]*ConfigurationItem, error)
- func (c *GRPCClient) GetEventLogByCommandId(ctx context.Context, in *pb.GetEventLogByCommandIdRequest) (*pb.GetEventLogByCommandIdResponse, error)
- func (c *GRPCClient) GetSecret(ctx context.Context, storeName, key string, meta map[string]string) (data map[string]string, err error)
- func (c *GRPCClient) GetState(ctx context.Context, storeName, key string, meta map[string]string) (item *StateItem, err error)
- func (c *GRPCClient) GetStateWithConsistency(ctx context.Context, storeName, key string, meta map[string]string, ...) (*StateItem, error)
- func (c *GRPCClient) ImplActorClientStub(actorClientStub actor.Client, opt ...config.Option)
- func (c *GRPCClient) InvokeActor(ctx context.Context, in *InvokeActorRequest) (out *InvokeActorResponse, err error)
- func (c *GRPCClient) InvokeBinding(ctx context.Context, in *InvokeBindingRequest) (*BindingEvent, error)
- func (c *GRPCClient) InvokeMethod(ctx context.Context, appID, methodName, verb string) (out []byte, err error)
- func (c *GRPCClient) InvokeMethodWithContent(ctx context.Context, appID, methodName, verb string, content *DataContent) (out []byte, err error)
- func (c *GRPCClient) InvokeMethodWithCustomContent(ctx context.Context, appID, methodName, verb string, contentType string, ...) ([]byte, error)
- func (c *GRPCClient) InvokeOutputBinding(ctx context.Context, in *InvokeBindingRequest) error
- func (c *GRPCClient) LoadEvents(ctx context.Context, req *pb.LoadEventRequest) (*pb.LoadEventResponse, error)
- func (c *GRPCClient) PublishEvent(ctx context.Context, pubsubName, topicName string, data interface{}, ...) error
- func (c *GRPCClient) PublishEventfromCustomContent(ctx context.Context, pubsubName, topicName string, data interface{}) error
- func (c *GRPCClient) QueryStateAlpha1(ctx context.Context, storeName, query string, meta map[string]string) (*QueryResponse, error)
- func (c *GRPCClient) RegisterActorReminder(ctx context.Context, in *RegisterActorReminderRequest) (err error)
- func (c *GRPCClient) RegisterActorTimer(ctx context.Context, in *RegisterActorTimerRequest) (err error)
- func (c *GRPCClient) RenameActorReminder(ctx context.Context, in *RenameActorReminderRequest) error
- func (c *GRPCClient) SaveBulkState(ctx context.Context, storeName string, items ...*SetStateItem) error
- func (c *GRPCClient) SaveSnapshot(ctx context.Context, in *pb.SaveSnapshotRequest) (*pb.SaveSnapshotResponse, error)
- func (c *GRPCClient) SaveState(ctx context.Context, storeName, key string, data []byte, ...) error
- func (c *GRPCClient) SaveStateTransactionally(ctx context.Context, actorType, actorID string, ...) error
- func (c *GRPCClient) Shutdown(ctx context.Context) error
- func (c *GRPCClient) SubscribeConfigurationItems(ctx context.Context, storeName string, keys []string, ...) error
- func (c *GRPCClient) UnregisterActorReminder(ctx context.Context, in *UnregisterActorReminderRequest) error
- func (c *GRPCClient) UnregisterActorTimer(ctx context.Context, in *UnregisterActorTimerRequest) error
- func (c *GRPCClient) UnsubscribeConfigurationItems(ctx context.Context, storeName string, id string, opts ...ConfigurationOpt) error
- func (c *GRPCClient) UpdateAppLog(ctx context.Context, in *pb.UpdateAppLogRequest) (*pb.UpdateAppLogResponse, error)
- func (c *GRPCClient) UpdateEventLog(ctx context.Context, in *pb.UpdateEventLogRequest) (*pb.UpdateEventLogResponse, error)
- func (c *GRPCClient) WithAuthToken(token string)
- func (c *GRPCClient) WithTraceID(ctx context.Context, id string) context.Context
- func (c *GRPCClient) WriteAppLog(ctx context.Context, in *pb.WriteAppLogRequest) (*pb.WriteAppLogResponse, error)
- func (c *GRPCClient) WriteEventLog(ctx context.Context, in *pb.WriteEventLogRequest) (*pb.WriteEventLogResponse, error)
- type GetActorStateRequest
- type GetActorStateResponse
- type InvokeActorRequest
- type InvokeActorResponse
- type InvokeBindingRequest
- type OperationType
- type PublishEventOption
- type QueryItem
- type QueryResponse
- type RegisterActorReminderRequest
- type RegisterActorTimerRequest
- type RenameActorReminderRequest
- type SetStateItem
- type StateConcurrency
- type StateConsistency
- type StateItem
- type StateOperation
- type StateOption
- type StateOptions
- type UnregisterActorReminderRequest
- type UnregisterActorTimerRequest
Constants ¶
const ( // StateConsistencyUndefined is the undefined value for state consistency. StateConsistencyUndefined StateConsistency = 0 // StateConsistencyEventual represents eventual state consistency value. StateConsistencyEventual StateConsistency = 1 // StateConsistencyStrong represents strong state consistency value. StateConsistencyStrong StateConsistency = 2 // StateConcurrencyUndefined is the undefined value for state concurrency. StateConcurrencyUndefined StateConcurrency = 0 // StateConcurrencyFirstWrite represents first write concurrency value. StateConcurrencyFirstWrite StateConcurrency = 1 // StateConcurrencyLastWrite represents last write concurrency value. StateConcurrencyLastWrite StateConcurrency = 2 // StateOperationTypeUndefined is the undefined value for state operation type. StateOperationTypeUndefined OperationType = 0 // StateOperationTypeUpsert represents upsert operation type value. StateOperationTypeUpsert OperationType = 1 // StateOperationTypeDelete represents delete operation type value. StateOperationTypeDelete OperationType = 2 // UndefinedType represents undefined type value. UndefinedType = "undefined" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActorStateOperation ¶
type BindingEvent ¶
type BindingEvent struct { // Data is the input bindings sent Data []byte // Metadata is the input binding metadata Metadata map[string]string }
BindingEvent represents the binding event handler input.
type BulkStateItem ¶
type BulkStateItem struct { Key string Value []byte Etag string Metadata map[string]string Error string }
BulkStateItem represents a single state item.
type Client ¶
type Client interface { // InvokeBinding invokes specific operation on the configured Dapr binding. // This method covers input, output, and bi-directional bindings. InvokeBinding(ctx context.Context, in *InvokeBindingRequest) (out *BindingEvent, err error) // InvokeOutputBinding invokes configured Dapr binding with data.InvokeOutputBinding // This method differs from InvokeBinding in that it doesn't expect any content being returned from the invoked method. InvokeOutputBinding(ctx context.Context, in *InvokeBindingRequest) error // InvokeMethod invokes service without raw data InvokeMethod(ctx context.Context, appID, methodName, verb string) (out []byte, err error) // InvokeMethodWithContent invokes service with content InvokeMethodWithContent(ctx context.Context, appID, methodName, verb string, content *DataContent) (out []byte, err error) // InvokeMethodWithCustomContent invokes app with custom content (struct + content type). InvokeMethodWithCustomContent(ctx context.Context, appID, methodName, verb string, contentType string, content interface{}) (out []byte, err error) // PublishEvent publishes data onto topic in specific pubsub component. PublishEvent(ctx context.Context, pubsubName, topicName string, data interface{}, opts ...PublishEventOption) error // PublishEventfromCustomContent serializes an struct and publishes its contents as data (JSON) onto topic in specific pubsub component. // Deprecated: This method is deprecated and will be removed in a future version of the SDK. Please use `PublishEvent` instead. PublishEventfromCustomContent(ctx context.Context, pubsubName, topicName string, data interface{}) error // GetSecret retrieves preconfigured secret from specified store using key. GetSecret(ctx context.Context, storeName, key string, meta map[string]string) (data map[string]string, err error) // GetBulkSecret retrieves all preconfigured secrets for this application. GetBulkSecret(ctx context.Context, storeName string, meta map[string]string) (data map[string]map[string]string, err error) // SaveState saves the raw data into store using default state options. SaveState(ctx context.Context, storeName, key string, data []byte, meta map[string]string, so ...StateOption) error // SaveBulkState saves multiple state item to store with specified options. SaveBulkState(ctx context.Context, storeName string, items ...*SetStateItem) error // GetState retrieves state from specific store using default consistency option. GetState(ctx context.Context, storeName, key string, meta map[string]string) (item *StateItem, err error) // GetStateWithConsistency retrieves state from specific store using provided state consistency. GetStateWithConsistency(ctx context.Context, storeName, key string, meta map[string]string, sc StateConsistency) (item *StateItem, err error) // GetBulkState retrieves state for multiple keys from specific store. GetBulkState(ctx context.Context, storeName string, keys []string, meta map[string]string, parallelism int32) ([]*BulkStateItem, error) // QueryStateAlpha1 runs a query against state store. QueryStateAlpha1(ctx context.Context, storeName, query string, meta map[string]string) (*QueryResponse, error) // DeleteState deletes content from store using default state options. DeleteState(ctx context.Context, storeName, key string, meta map[string]string) error // DeleteStateWithETag deletes content from store using provided state options and etag. DeleteStateWithETag(ctx context.Context, storeName, key string, etag *ETag, meta map[string]string, opts *StateOptions) error // ExecuteStateTransaction provides way to execute multiple operations on a specified store. ExecuteStateTransaction(ctx context.Context, storeName string, meta map[string]string, ops []*StateOperation) error // GetConfigurationItem can get target configuration item by storeName and key GetConfigurationItem(ctx context.Context, storeName, key string, opts ...ConfigurationOpt) (*ConfigurationItem, error) // GetConfigurationItems can get a list of configuration item by storeName and keys GetConfigurationItems(ctx context.Context, storeName string, keys []string, opts ...ConfigurationOpt) ([]*ConfigurationItem, error) // SubscribeConfigurationItems can subscribe the change of configuration items by storeName and keys, and return subscription id SubscribeConfigurationItems(ctx context.Context, storeName string, keys []string, handler ConfigurationHandleFunction, opts ...ConfigurationOpt) error // UnsubscribeConfigurationItems can stop the subscription with target store's and id UnsubscribeConfigurationItems(ctx context.Context, storeName string, id string, opts ...ConfigurationOpt) error // DeleteBulkState deletes content for multiple keys from store. DeleteBulkState(ctx context.Context, storeName string, keys []string, meta map[string]string) error // DeleteBulkState deletes content for multiple keys from store. DeleteBulkStateItems(ctx context.Context, storeName string, items []*DeleteStateItem) error // Shutdown the sidecar. Shutdown(ctx context.Context) error // WithTraceID adds existing trace ID to the outgoing context. WithTraceID(ctx context.Context, id string) context.Context // WithAuthToken sets Dapr API token on the instantiated client. WithAuthToken(token string) // Close cleans up all resources created by the client. Close() // RegisterActorTimer registers an actor timer. RegisterActorTimer(ctx context.Context, req *RegisterActorTimerRequest) error // UnregisterActorTimer unregisters an actor timer. UnregisterActorTimer(ctx context.Context, req *UnregisterActorTimerRequest) error // RegisterActorReminder registers an actor reminder. RegisterActorReminder(ctx context.Context, req *RegisterActorReminderRequest) error // UnregisterActorReminder unregisters an actor reminder. UnregisterActorReminder(ctx context.Context, req *UnregisterActorReminderRequest) error // RenameActorReminder rename an actor reminder. RenameActorReminder(ctx context.Context, req *RenameActorReminderRequest) error // InvokeActor calls a method on an actor. InvokeActor(ctx context.Context, req *InvokeActorRequest) (*InvokeActorResponse, error) // GetActorState get actor state GetActorState(ctx context.Context, req *GetActorStateRequest) (data *GetActorStateResponse, err error) // SaveStateTransactionally save actor state SaveStateTransactionally(ctx context.Context, actorType, actorID string, operations []*ActorStateOperation) error // ImplActorClientStub is to impl user defined actor client stub ImplActorClientStub(actorClientStub actor.Client, opt ...config.Option) // LoadEvents 加载事件 LoadEvents(context.Context, *pb.LoadEventRequest) (*pb.LoadEventResponse, error) // SaveSnapshot 保存事件快照 SaveSnapshot(context.Context, *pb.SaveSnapshotRequest) (*pb.SaveSnapshotResponse, error) // ApplyEvent 应用事件到聚合根上 ApplyEvent(context.Context, *pb.ApplyEventRequest) (*pb.ApplyEventResponse, error) // CreateEvent 创建聚合 CreateEvent(context.Context, *pb.CreateEventRequest) (*pb.CreateEventResponse, error) // DeleteEvent 创建聚合 DeleteEvent(context.Context, *pb.DeleteEventRequest) (*pb.DeleteEventResponse, error) // WriteEventLog 写事件日志 WriteEventLog(context.Context, *pb.WriteEventLogRequest) (*pb.WriteEventLogResponse, error) // UpdateEventLog 更新事件日志 UpdateEventLog(context.Context, *pb.UpdateEventLogRequest) (*pb.UpdateEventLogResponse, error) // GetEventLogByCommandId 按命令id获取事件日志 GetEventLogByCommandId(context.Context, *pb.GetEventLogByCommandIdRequest) (*pb.GetEventLogByCommandIdResponse, error) // WriteAppLog 写应用日志 WriteAppLog(context.Context, *pb.WriteAppLogRequest) (*pb.WriteAppLogResponse, error) // UpdateAppLog 更新应用日志 UpdateAppLog(context.Context, *pb.UpdateAppLogRequest) (*pb.UpdateAppLogResponse, error) // GetAppLogById 按id获取应用日志 GetAppLogById(context.Context, *pb.GetAppLogByIdRequest) (*pb.GetAppLogByIdResponse, error) }
Client is the interface for Dapr client implementation.
func NewClient ¶
NewClient instantiates Dapr client using DAPR_GRPC_PORT environment variable as port. Note, this default factory function creates Dapr client only once. All subsequent invocations will return the already created instance. To create multiple instances of the Dapr client, use one of the parameterized factory functions:
NewClientWithPort(port string) (client Client, err error) NewClientWithAddress(address string) (client Client, err error) NewClientWithConnection(conn *grpc.ClientConn) Client NewClientWithSocket(socket string) (client Client, err error)
func NewClientWithAddress ¶
NewClientWithAddress instantiates Dapr using specific address (including port).
func NewClientWithConnection ¶
func NewClientWithConnection(conn *grpc.ClientConn) Client
NewClientWithConnection instantiates Dapr client using specific connection.
func NewClientWithPort ¶
NewClientWithPort instantiates Dapr using specific port.
func NewClientWithSocket ¶
NewClientWithSocket instantiates Dapr using specific socket.
type ConfigurationHandleFunction ¶
type ConfigurationHandleFunction func(string, []*ConfigurationItem)
type ConfigurationItem ¶
type ConfigurationOpt ¶
func WithConfigurationMetadata ¶
func WithConfigurationMetadata(key, value string) ConfigurationOpt
type DataContent ¶
type DataContent struct { // Data is the input data Data []byte // ContentType is the type of the data content ContentType string }
DataContent the service invocation content.
type DeleteStateItem ¶
type DeleteStateItem SetStateItem
DeleteStateItem represents a single state to be deleted.
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
GRPCClient is the gRPC implementation of Dapr client.
func (*GRPCClient) ApplyEvent ¶
func (c *GRPCClient) ApplyEvent(ctx context.Context, in *pb.ApplyEventRequest) (*pb.ApplyEventResponse, error)
ApplyEvent @Description: liuxd: DDD event storage apply event @receiver c @param ctx @param in @return *pb.ApplyEventsResponse @return error
func (*GRPCClient) Close ¶
func (c *GRPCClient) Close()
Close cleans up all resources created by the client.
func (*GRPCClient) CreateEvent ¶
func (c *GRPCClient) CreateEvent(ctx context.Context, request *pb.CreateEventRequest) (*pb.CreateEventResponse, error)
CreateEvent @Description: @receiver c @param ctx @param request @return *pb.CreateEventResponse @return error
func (*GRPCClient) DeleteBulkState ¶
func (c *GRPCClient) DeleteBulkState(ctx context.Context, storeName string, keys []string, meta map[string]string) error
DeleteBulkState deletes content for multiple keys from store.
func (*GRPCClient) DeleteBulkStateItems ¶
func (c *GRPCClient) DeleteBulkStateItems(ctx context.Context, storeName string, items []*DeleteStateItem) error
DeleteBulkState deletes content for multiple keys from store.
func (*GRPCClient) DeleteEvent ¶
func (c *GRPCClient) DeleteEvent(ctx context.Context, request *pb.DeleteEventRequest) (*pb.DeleteEventResponse, error)
DeleteEvent @Description: @receiver c @param ctx @param request @return *pb.DeleteEventResponse @return error
func (*GRPCClient) DeleteState ¶
func (c *GRPCClient) DeleteState(ctx context.Context, storeName, key string, meta map[string]string) error
DeleteState deletes content from store using default state options.
func (*GRPCClient) DeleteStateWithETag ¶
func (c *GRPCClient) DeleteStateWithETag(ctx context.Context, storeName, key string, etag *ETag, meta map[string]string, opts *StateOptions) error
DeleteStateWithETag deletes content from store using provided state options and etag.
func (*GRPCClient) ExecuteStateTransaction ¶
func (c *GRPCClient) ExecuteStateTransaction(ctx context.Context, storeName string, meta map[string]string, ops []*StateOperation) error
ExecuteStateTransaction provides way to execute multiple operations on a specified store.
func (*GRPCClient) GetActorState ¶
func (c *GRPCClient) GetActorState(ctx context.Context, in *GetActorStateRequest) (*GetActorStateResponse, error)
func (*GRPCClient) GetAppLogById ¶
func (c *GRPCClient) GetAppLogById(ctx context.Context, in *pb.GetAppLogByIdRequest) (*pb.GetAppLogByIdResponse, error)
func (*GRPCClient) GetBulkSecret ¶
func (c *GRPCClient) GetBulkSecret(ctx context.Context, storeName string, meta map[string]string) (data map[string]map[string]string, err error)
GetBulkSecret retrieves all preconfigured secrets for this application.
func (*GRPCClient) GetBulkState ¶
func (c *GRPCClient) GetBulkState(ctx context.Context, storeName string, keys []string, meta map[string]string, parallelism int32) ([]*BulkStateItem, error)
GetBulkState retrieves state for multiple keys from specific store.
func (*GRPCClient) GetConfigurationItem ¶
func (c *GRPCClient) GetConfigurationItem(ctx context.Context, storeName, key string, opts ...ConfigurationOpt) (*ConfigurationItem, error)
func (*GRPCClient) GetConfigurationItems ¶
func (c *GRPCClient) GetConfigurationItems(ctx context.Context, storeName string, keys []string, opts ...ConfigurationOpt) ([]*ConfigurationItem, error)
func (*GRPCClient) GetEventLogByCommandId ¶
func (c *GRPCClient) GetEventLogByCommandId(ctx context.Context, in *pb.GetEventLogByCommandIdRequest) (*pb.GetEventLogByCommandIdResponse, error)
func (*GRPCClient) GetSecret ¶
func (c *GRPCClient) GetSecret(ctx context.Context, storeName, key string, meta map[string]string) (data map[string]string, err error)
GetSecret retrieves preconfigured secret from specified store using key.
func (*GRPCClient) GetState ¶
func (c *GRPCClient) GetState(ctx context.Context, storeName, key string, meta map[string]string) (item *StateItem, err error)
GetState retrieves state from specific store using default consistency option.
func (*GRPCClient) GetStateWithConsistency ¶
func (c *GRPCClient) GetStateWithConsistency(ctx context.Context, storeName, key string, meta map[string]string, sc StateConsistency) (*StateItem, error)
GetStateWithConsistency retrieves state from specific store using provided state consistency.
func (*GRPCClient) ImplActorClientStub ¶
func (c *GRPCClient) ImplActorClientStub(actorClientStub actor.Client, opt ...config.Option)
ImplActorClientStub impls the given client stub @actorClientStub, an example of client stub is as followed
type ClientStub struct { // User defined function
GetUser func(context.Context, *User) (*User, error) Invoke func(context.Context, string) (string, error) Get func(context.Context) (string, error) Post func(context.Context, string) error StartTimer func(context.Context, *TimerRequest) error StopTimer func(context.Context, *TimerRequest) error ... }
// Type defined the target type, which should be compatible with server side actor
func (a *ClientStub) Type() string { return "testActorType" }
// ID defined actor ID to be invoked
func (a *ClientStub) ID() string { return "ActorImplID123456" }.
func (*GRPCClient) InvokeActor ¶
func (c *GRPCClient) InvokeActor(ctx context.Context, in *InvokeActorRequest) (out *InvokeActorResponse, err error)
InvokeActor invokes specific operation on the configured Dapr binding. This method covers input, output, and bi-directional bindings.
func (*GRPCClient) InvokeBinding ¶
func (c *GRPCClient) InvokeBinding(ctx context.Context, in *InvokeBindingRequest) (*BindingEvent, error)
InvokeBinding invokes specific operation on the configured Dapr binding. This method covers input, output, and bi-directional bindings.
func (*GRPCClient) InvokeMethod ¶
func (c *GRPCClient) InvokeMethod(ctx context.Context, appID, methodName, verb string) (out []byte, err error)
InvokeMethod invokes service without raw data ([]byte).
func (*GRPCClient) InvokeMethodWithContent ¶
func (c *GRPCClient) InvokeMethodWithContent(ctx context.Context, appID, methodName, verb string, content *DataContent) (out []byte, err error)
InvokeMethodWithContent invokes service with content (data + content type).
func (*GRPCClient) InvokeMethodWithCustomContent ¶
func (c *GRPCClient) InvokeMethodWithCustomContent(ctx context.Context, appID, methodName, verb string, contentType string, content interface{}) ([]byte, error)
InvokeMethodWithCustomContent invokes service with custom content (struct + content type).
func (*GRPCClient) InvokeOutputBinding ¶
func (c *GRPCClient) InvokeOutputBinding(ctx context.Context, in *InvokeBindingRequest) error
InvokeOutputBinding invokes configured Dapr binding with data (allows nil).InvokeOutputBinding This method differs from InvokeBinding in that it doesn't expect any content being returned from the invoked method.
func (*GRPCClient) LoadEvents ¶
func (c *GRPCClient) LoadEvents(ctx context.Context, req *pb.LoadEventRequest) (*pb.LoadEventResponse, error)
LoadEvents @Description: DDD event storage get aggregate root by id @receiver c @param ctx @param req @return *pb.LoadEventResponse @return error
func (*GRPCClient) PublishEvent ¶
func (c *GRPCClient) PublishEvent(ctx context.Context, pubsubName, topicName string, data interface{}, opts ...PublishEventOption) error
PublishEvent publishes data onto specific pubsub topic.
func (*GRPCClient) PublishEventfromCustomContent ¶
func (c *GRPCClient) PublishEventfromCustomContent(ctx context.Context, pubsubName, topicName string, data interface{}) error
PublishEventfromCustomContent serializes an struct and publishes its contents as data (JSON) onto topic in specific pubsub component. Deprecated: This method is deprecated and will be removed in a future version of the SDK. Please use `PublishEvent` instead.
func (*GRPCClient) QueryStateAlpha1 ¶
func (c *GRPCClient) QueryStateAlpha1(ctx context.Context, storeName, query string, meta map[string]string) (*QueryResponse, error)
QueryStateAlpha1 runs a query against state store.
func (*GRPCClient) RegisterActorReminder ¶
func (c *GRPCClient) RegisterActorReminder(ctx context.Context, in *RegisterActorReminderRequest) (err error)
RegisterActorReminder registers a new reminder to target actor. Then, a reminder would be created and invoke actor's ReminderCall function if implemented. If server side actor impls this function, it's asserted to actor.ReminderCallee and can be invoked with call period and state data as param @in defined. Scheduling parameters 'DueTime', 'Period', and 'TTL' are optional.
func (*GRPCClient) RegisterActorTimer ¶
func (c *GRPCClient) RegisterActorTimer(ctx context.Context, in *RegisterActorTimerRequest) (err error)
RegisterActorTimer register actor timer as given param @in defined. Scheduling parameters 'DueTime', 'Period', and 'TTL' are optional.
func (*GRPCClient) RenameActorReminder ¶
func (c *GRPCClient) RenameActorReminder(ctx context.Context, in *RenameActorReminderRequest) error
RenameActorReminder would rename the actor reminder.
func (*GRPCClient) SaveBulkState ¶
func (c *GRPCClient) SaveBulkState(ctx context.Context, storeName string, items ...*SetStateItem) error
SaveBulkState saves the multiple state item to store.
func (*GRPCClient) SaveSnapshot ¶
func (c *GRPCClient) SaveSnapshot(ctx context.Context, in *pb.SaveSnapshotRequest) (*pb.SaveSnapshotResponse, error)
SaveSnapshot @Description: liuxd: DDD event storage apply event @receiver c @param ctx @param in @return *pb.SaveSnapshotResponse @return error
func (*GRPCClient) SaveState ¶
func (c *GRPCClient) SaveState(ctx context.Context, storeName, key string, data []byte, meta map[string]string, so ...StateOption) error
SaveState saves the raw data into store, default options: strong, last-write.
func (*GRPCClient) SaveStateTransactionally ¶
func (c *GRPCClient) SaveStateTransactionally(ctx context.Context, actorType, actorID string, operations []*ActorStateOperation) error
func (*GRPCClient) Shutdown ¶
func (c *GRPCClient) Shutdown(ctx context.Context) error
Shutdown the sidecar.
func (*GRPCClient) SubscribeConfigurationItems ¶
func (c *GRPCClient) SubscribeConfigurationItems(ctx context.Context, storeName string, keys []string, handler ConfigurationHandleFunction, opts ...ConfigurationOpt) error
func (*GRPCClient) UnregisterActorReminder ¶
func (c *GRPCClient) UnregisterActorReminder(ctx context.Context, in *UnregisterActorReminderRequest) error
UnregisterActorReminder would unregister the actor reminder.
func (*GRPCClient) UnregisterActorTimer ¶
func (c *GRPCClient) UnregisterActorTimer(ctx context.Context, in *UnregisterActorTimerRequest) error
UnregisterActorTimer unregisters actor timer.
func (*GRPCClient) UnsubscribeConfigurationItems ¶
func (c *GRPCClient) UnsubscribeConfigurationItems(ctx context.Context, storeName string, id string, opts ...ConfigurationOpt) error
func (*GRPCClient) UpdateAppLog ¶
func (c *GRPCClient) UpdateAppLog(ctx context.Context, in *pb.UpdateAppLogRequest) (*pb.UpdateAppLogResponse, error)
func (*GRPCClient) UpdateEventLog ¶
func (c *GRPCClient) UpdateEventLog(ctx context.Context, in *pb.UpdateEventLogRequest) (*pb.UpdateEventLogResponse, error)
func (*GRPCClient) WithAuthToken ¶
func (c *GRPCClient) WithAuthToken(token string)
WithAuthToken sets Dapr API token on the instantiated client. Allows empty string to reset token on existing client.
func (*GRPCClient) WithTraceID ¶
WithTraceID adds existing trace ID to the outgoing context.
func (*GRPCClient) WriteAppLog ¶
func (c *GRPCClient) WriteAppLog(ctx context.Context, in *pb.WriteAppLogRequest) (*pb.WriteAppLogResponse, error)
func (*GRPCClient) WriteEventLog ¶
func (c *GRPCClient) WriteEventLog(ctx context.Context, in *pb.WriteEventLogRequest) (*pb.WriteEventLogResponse, error)
type GetActorStateRequest ¶
type GetActorStateResponse ¶
type GetActorStateResponse struct {
Data []byte
}
type InvokeActorRequest ¶
type InvokeActorResponse ¶
type InvokeActorResponse struct {
Data []byte
}
type InvokeBindingRequest ¶
type InvokeBindingRequest struct { // Name is name of binding to invoke. Name string // Operation is the name of the operation type for the binding to invoke Operation string // Data is the input bindings sent Data []byte // Metadata is the input binding metadata Metadata map[string]string }
InvokeBindingRequest represents binding invocation request.
type OperationType ¶
type OperationType int
OperationType is the operation enum type.
func (OperationType) String ¶
func (o OperationType) String() string
String returns the string value of the OperationType.
type PublishEventOption ¶
type PublishEventOption func(*pb.PublishEventRequest)
PublishEventOption is the type for the functional option.
func PublishEventWithContentType ¶
func PublishEventWithContentType(contentType string) PublishEventOption
PublishEventWithContentType can be passed as option to PublishEvent to set an explicit Content-Type.
func PublishEventWithMetadata ¶
func PublishEventWithMetadata(metadata map[string]string) PublishEventOption
PublishEventWithMetadata can be passed as option to PublishEvent to set metadata.
func PublishEventWithRawPayload ¶
func PublishEventWithRawPayload() PublishEventOption
PublishEventWithRawPayload can be passed as option to PublishEvent to set rawPayload metadata.
type QueryResponse ¶
QueryResponse represents a query result.
type SetStateItem ¶
type SetStateItem struct { Key string Value []byte Etag *ETag Metadata map[string]string Options *StateOptions }
SetStateItem represents a single state to be persisted.
type StateConcurrency ¶
type StateConcurrency int
StateConcurrency is the concurrency enum type.
func (StateConcurrency) GetPBConcurrency ¶
func (s StateConcurrency) GetPBConcurrency() v1.StateOptions_StateConcurrency
GetPBConcurrency get concurrency pb value.
func (StateConcurrency) String ¶
func (s StateConcurrency) String() string
String returns the string value of the StateConcurrency.
type StateConsistency ¶
type StateConsistency int
StateConsistency is the consistency enum type.
func (StateConsistency) GetPBConsistency ¶
func (s StateConsistency) GetPBConsistency() v1.StateOptions_StateConsistency
GetPBConsistency get consistency pb value.
func (StateConsistency) String ¶
func (s StateConsistency) String() string
String returns the string value of the StateConsistency.
type StateOperation ¶
type StateOperation struct { Type OperationType Item *SetStateItem }
StateOperation is a collection of StateItems with a store name.
type StateOption ¶
type StateOption func(*StateOptions)
StateOption StateOptions's function type.
func WithConcurrency ¶
func WithConcurrency(concurrency StateConcurrency) StateOption
WithConcurrency set StateOptions's Concurrency.
func WithConsistency ¶
func WithConsistency(consistency StateConsistency) StateOption
WithConsistency set StateOptions's consistency.
type StateOptions ¶
type StateOptions struct { Concurrency StateConcurrency Consistency StateConsistency }
StateOptions represents the state store persistence policy.