Documentation ¶
Index ¶
- func GetDialAddressPrefix(mode modes.DaprMode) string
- func GetFreePort() (int, error)
- type API
- type Manager
- func (g *Manager) CreateLocalChannel(port, maxConcurrency int, spec config.TracingSpec) (channel.AppChannel, error)
- func (g *Manager) GetGRPCConnection(address, id string, namespace string, skipTLS, recreateIfExists bool) (*grpc.ClientConn, error)
- func (g *Manager) SetAuthenticator(auth security.Authenticator)
- type Server
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDialAddressPrefix ¶ added in v0.7.0
GetDialAddressPrefix returns a dial prefix for a gRPC client connections For a given DaprMode.
func GetFreePort ¶ added in v0.6.0
GetFreePort returns a free port from the OS
Types ¶
type API ¶
type API interface { // DaprInternal Service methods CallActor(ctx context.Context, in *internalv1pb.InternalInvokeRequest) (*internalv1pb.InternalInvokeResponse, error) CallLocal(ctx context.Context, in *internalv1pb.InternalInvokeRequest) (*internalv1pb.InternalInvokeResponse, error) // Dapr Service methods PublishEvent(ctx context.Context, in *runtimev1pb.PublishEventRequest) (*empty.Empty, error) InvokeService(ctx context.Context, in *runtimev1pb.InvokeServiceRequest) (*commonv1pb.InvokeResponse, error) InvokeBinding(ctx context.Context, in *runtimev1pb.InvokeBindingRequest) (*runtimev1pb.InvokeBindingResponse, error) GetState(ctx context.Context, in *runtimev1pb.GetStateRequest) (*runtimev1pb.GetStateResponse, error) GetBulkState(ctx context.Context, in *runtimev1pb.GetBulkStateRequest) (*runtimev1pb.GetBulkStateResponse, error) GetSecret(ctx context.Context, in *runtimev1pb.GetSecretRequest) (*runtimev1pb.GetSecretResponse, error) SaveState(ctx context.Context, in *runtimev1pb.SaveStateRequest) (*empty.Empty, error) DeleteState(ctx context.Context, in *runtimev1pb.DeleteStateRequest) (*empty.Empty, error) ExecuteStateTransaction(ctx context.Context, in *runtimev1pb.ExecuteStateTransactionRequest) (*empty.Empty, error) }
API is the gRPC interface for the Dapr gRPC API. It implements both the internal and external proto definitions.
func NewAPI ¶
func NewAPI( appID string, appChannel channel.AppChannel, stateStores map[string]state.Store, secretStores map[string]secretstores.SecretStore, secretsConfiguration map[string]config.SecretsScope, publishFn func(req *pubsub.PublishRequest) error, directMessaging messaging.DirectMessaging, actor actors.Actors, sendToOutputBindingFn func(name string, req *bindings.InvokeRequest) (*bindings.InvokeResponse, error), tracingSpec config.TracingSpec, accessControlList *config.AccessControlList, appProtocol string) API
NewAPI returns a new gRPC API
type Manager ¶
type Manager struct { AppClient *grpc.ClientConn // contains filtered or unexported fields }
Manager is a wrapper around gRPC connection pooling
func NewGRPCManager ¶
NewGRPCManager returns a new grpc manager
func (*Manager) CreateLocalChannel ¶
func (g *Manager) CreateLocalChannel(port, maxConcurrency int, spec config.TracingSpec) (channel.AppChannel, error)
CreateLocalChannel creates a new gRPC AppChannel
func (*Manager) GetGRPCConnection ¶
func (g *Manager) GetGRPCConnection(address, id string, namespace string, skipTLS, recreateIfExists bool) (*grpc.ClientConn, error)
GetGRPCConnection returns a new grpc connection for a given address and inits one if doesn't exist
func (*Manager) SetAuthenticator ¶ added in v0.4.0
func (g *Manager) SetAuthenticator(auth security.Authenticator)
SetAuthenticator sets the gRPC manager a tls authenticator context
type Server ¶
type Server interface {
StartNonBlocking() error
}
Server is an interface for the dapr gRPC server
func NewAPIServer ¶ added in v0.6.0
func NewAPIServer(api API, config ServerConfig, tracingSpec config.TracingSpec, metricSpec config.MetricSpec) Server
NewAPIServer returns a new user facing gRPC API server
func NewInternalServer ¶ added in v0.6.0
func NewInternalServer(api API, config ServerConfig, tracingSpec config.TracingSpec, metricSpec config.MetricSpec, authenticator auth.Authenticator) Server
NewInternalServer returns a new gRPC server for Dapr to Dapr communications
type ServerConfig ¶
type ServerConfig struct { AppID string HostAddress string Port int NameSpace string TrustDomain string }
ServerConfig is the config object for a grpc server
func NewServerConfig ¶
func NewServerConfig(appID string, hostAddress string, port int, namespace string, trustDomain string) ServerConfig
NewServerConfig returns a new grpc server config