Documentation
¶
Index ¶
- Variables
- func ValidateHostEnvironment(mTLSEnabled bool, mode modes.DaprMode, namespace string) error
- type ActiveActorsCount
- type ActorHostedRequest
- type ActorLock
- type ActorMetadata
- type ActorRemindersMetadata
- type Actors
- type Config
- func (c *Config) GetDrainOngoingTimeoutForType(actorType string) time.Duration
- func (c *Config) GetDrainRebalancedActorsForType(actorType string) bool
- func (c *Config) GetIdleTimeoutForType(actorType string) time.Duration
- func (c *Config) GetReentrancyForType(actorType string) app_config.ReentrancyConfig
- func (c *Config) GetRemindersPartitionCountForType(actorType string) int
- type CreateReminderRequest
- type CreateTimerRequest
- type DeleteReminderRequest
- type DeleteStateRequest
- type DeleteTimerRequest
- type EntityConfig
- type GetReminderRequest
- type GetStateRequest
- type OperationType
- type Reminder
- type ReminderResponse
- type ReminderTrack
- type RenameReminderRequest
- type SaveStateRequest
- type StateResponse
- type TimerResponse
- type TransactionalDelete
- type TransactionalOperation
- type TransactionalRequest
- type TransactionalUpsert
Constants ¶
This section is empty.
Variables ¶
var ErrActorDisposed error = errors.New("actor is already disposed")
ErrActorDisposed is the error when runtime tries to hold the lock of the disposed actor.
var ErrDaprResponseHeader = errors.New("error indicated via actor header response")
var ErrMaxStackDepthExceeded error = errors.New("Maximum stack depth exceeded")
Functions ¶
Types ¶
type ActiveActorsCount ¶ added in v0.5.0
ActiveActorsCount contain actorType and count of actors each type has.
type ActorHostedRequest ¶
type ActorHostedRequest struct {
ActorID string `json:"actorId"`
ActorType string `json:"actorType"`
}
ActorHostedRequest is the request object for checking if an actor is hosted on this instance.
type ActorLock ¶ added in v1.2.0
type ActorLock struct {
// contains filtered or unexported fields
}
func NewActorLock ¶ added in v1.2.0
type ActorMetadata ¶ added in v1.3.0
type ActorMetadata struct {
ID string `json:"id"`
RemindersMetadata ActorRemindersMetadata `json:"actorRemindersMetadata"`
Etag *string `json:"-"`
}
ActorMetadata represents information about the actor type.
type ActorRemindersMetadata ¶ added in v1.3.0
type ActorRemindersMetadata struct {
PartitionCount int `json:"partitionCount"`
// contains filtered or unexported fields
}
ActorRemindersMetadata represents information about actor's reminders.
type Actors ¶
type Actors interface {
Call(ctx context.Context, req *invokev1.InvokeMethodRequest) (*invokev1.InvokeMethodResponse, error)
Init() error
Stop()
GetState(ctx context.Context, req *GetStateRequest) (*StateResponse, error)
TransactionalStateOperation(ctx context.Context, req *TransactionalRequest) error
GetReminder(ctx context.Context, req *GetReminderRequest) (*Reminder, error)
CreateReminder(ctx context.Context, req *CreateReminderRequest) error
DeleteReminder(ctx context.Context, req *DeleteReminderRequest) error
RenameReminder(ctx context.Context, req *RenameReminderRequest) error
CreateTimer(ctx context.Context, req *CreateTimerRequest) error
DeleteTimer(ctx context.Context, req *DeleteTimerRequest) error
IsActorHosted(ctx context.Context, req *ActorHostedRequest) bool
GetActiveActorsCount(ctx context.Context) []ActiveActorsCount
}
Actors allow calling into virtual actors as well as actor state management.
func NewActors ¶
func NewActors( stateStore state.Store, appChannel channel.AppChannel, grpcConnectionFn func(ctx context.Context, address, id string, namespace string, skipTLS, recreateIfExists, enableSSL bool, customOpts ...grpc.DialOption) (*grpc.ClientConn, error), config Config, certChain *dapr_credentials.CertChain, tracingSpec configuration.TracingSpec, features []configuration.FeatureSpec, resiliency resiliency.Provider, stateStoreName string) Actors
NewActors create a new actors runtime with given config.
type Config ¶
type Config struct {
HostAddress string
AppID string
PlacementAddresses []string
HostedActorTypes []string
Port int
HeartbeatInterval time.Duration
ActorDeactivationScanInterval time.Duration
ActorIdleTimeout time.Duration
DrainOngoingCallTimeout time.Duration
DrainRebalancedActors bool
Namespace string
Reentrancy app_config.ReentrancyConfig
RemindersStoragePartitions int
EntityConfigs map[string]EntityConfig
}
Config is the actor runtime configuration.
func NewConfig ¶
func NewConfig(hostAddress, appID string, placementAddresses []string, port int, namespace string, appConfig app_config.ApplicationConfig) Config
NewConfig returns the actor runtime configuration.
func (*Config) GetDrainOngoingTimeoutForType ¶ added in v1.7.0
func (*Config) GetDrainRebalancedActorsForType ¶ added in v1.7.0
func (*Config) GetIdleTimeoutForType ¶ added in v1.7.0
func (*Config) GetReentrancyForType ¶ added in v1.7.0
func (c *Config) GetReentrancyForType(actorType string) app_config.ReentrancyConfig
func (*Config) GetRemindersPartitionCountForType ¶ added in v1.7.0
type CreateReminderRequest ¶
type CreateReminderRequest struct {
Name string
ActorType string
ActorID string
Data interface{} `json:"data"`
DueTime string `json:"dueTime"`
Period string `json:"period"`
TTL string `json:"ttl"`
}
CreateReminderRequest is the request object to create a new reminder.
type CreateTimerRequest ¶
type CreateTimerRequest struct {
Name string
ActorType string
ActorID string
DueTime string `json:"dueTime"`
Period string `json:"period"`
TTL string `json:"ttl"`
Callback string `json:"callback"`
Data interface{} `json:"data"`
}
CreateTimerRequest is the request object to create a new timer.
type DeleteReminderRequest ¶
DeleteReminderRequest is the request object for deleting a reminder.
type DeleteStateRequest ¶
type DeleteStateRequest struct {
ActorID string `json:"actorId"`
ActorType string `json:"actorType"`
Key string `json:"key"`
}
DeleteStateRequest is the request object for deleting an actor state.
type DeleteTimerRequest ¶
DeleteTimerRequest is a request object for deleting a timer.
type EntityConfig ¶ added in v1.7.0
type EntityConfig struct {
Entities []string
ActorIdleTimeout time.Duration
DrainOngoingCallTimeout time.Duration
DrainRebalancedActors bool
ReentrancyConfig app_config.ReentrancyConfig
RemindersStoragePartitions int
}
Remap of app_config.EntityConfig but with more useful types for actors.go.
type GetReminderRequest ¶
GetReminderRequest is the request object to get an existing reminder.
type GetStateRequest ¶
type GetStateRequest struct {
ActorID string `json:"actorId"`
ActorType string `json:"actorType"`
Key string `json:"key"`
}
GetStateRequest is the request object for getting actor state.
type OperationType ¶
type OperationType string
OperationType describes a CRUD operation performed against a state store.
const Delete OperationType = "delete"
Delete is a delete operation.
const Upsert OperationType = "upsert"
Upsert is an update or create operation.
type Reminder ¶
type Reminder struct {
ActorID string `json:"actorID,omitempty"`
ActorType string `json:"actorType,omitempty"`
Name string `json:"name,omitempty"`
Data interface{} `json:"data"`
Period string `json:"period"`
DueTime string `json:"dueTime"`
RegisteredTime string `json:"registeredTime,omitempty"`
ExpirationTime string `json:"expirationTime,omitempty"`
}
Reminder represents a persisted reminder for a unique actor.
type ReminderResponse ¶
type ReminderResponse struct {
Data interface{} `json:"data"`
DueTime string `json:"dueTime"`
Period string `json:"period"`
}
ReminderResponse is the payload that is sent to an Actor SDK API for execution.
type ReminderTrack ¶
type ReminderTrack struct {
LastFiredTime string `json:"lastFiredTime"`
RepetitionLeft int `json:"repetitionLeft"`
}
ReminderTrack is a persisted object that keeps track of the last time a reminder fired.
type RenameReminderRequest ¶ added in v1.6.0
RenameReminderRequest is the request object for rename a reminder.
type SaveStateRequest ¶
type SaveStateRequest struct {
ActorID string `json:"actorId"`
ActorType string `json:"actorType"`
Key string `json:"key"`
Value interface{} `json:"value"`
}
SaveStateRequest is the request object for saving an actor state.
type StateResponse ¶
type StateResponse struct {
Data []byte `json:"data"`
}
StateResponse is the response returned from getting an actor state.
type TimerResponse ¶
type TimerResponse struct {
Callback string `json:"callback"`
Data interface{} `json:"data"`
DueTime string `json:"dueTime"`
Period string `json:"period"`
}
TimerResponse is the response object send to an Actor SDK API when a timer fires.
type TransactionalDelete ¶
type TransactionalDelete struct {
Key string `json:"key"`
}
TransactionalDelete defined a delete operation.
type TransactionalOperation ¶
type TransactionalOperation struct {
Operation OperationType `json:"operation"`
Request interface{} `json:"request"`
}
TransactionalOperation is the request object for a state operation participating in a transaction.
type TransactionalRequest ¶
type TransactionalRequest struct {
Operations []TransactionalOperation `json:"operations"`
ActorType string
ActorID string
}
TransactionalRequest describes a set of stateful operations for a given actor that are performed in a transactional manner.
type TransactionalUpsert ¶
type TransactionalUpsert struct {
Key string `json:"key"`
Value interface{} `json:"value"`
}
TransactionalUpsert defines a key/value pair for an upsert operation.
Source Files
¶
- actor.go
- actor_hosted_request.go
- actor_lock.go
- actors.go
- config.go
- create_reminder_request.go
- create_timer_request.go
- delete_reminder_request.go
- delete_state_request.go
- delete_timer_request.go
- get_reminder_request.go
- get_state_request.go
- reminder.go
- reminder_response.go
- reminder_track.go
- rename_reminder_request.go
- save_state_request.go
- state_response.go
- timer_response.go
- transactional_state_request.go