Documentation ¶
Index ¶
- Constants
- func GetHostAddress() (string, error)
- type Config
- type DaprRuntime
- type Option
- func WithExporters(exporters ...exporters.Exporter) Option
- func WithHTTPMiddleware(httpMiddleware ...http.Middleware) Option
- func WithInputBindings(inputBindings ...bindings.InputBinding) Option
- func WithOutputBindings(outputBindings ...bindings.OutputBinding) Option
- func WithPubSubs(pubsubs ...pubsub.PubSub) Option
- func WithSecretStores(secretStores ...secretstores.SecretStore) Option
- func WithServiceDiscovery(serviceDiscoveries ...servicediscovery.ServiceDiscovery) Option
- func WithStates(states ...state.State) Option
- type Protocol
Constants ¶
const ( // GRPCProtocol is a gRPC communication protocol GRPCProtocol Protocol = "grpc" // HTTPProtocol is a HTTP communication protocol HTTPProtocol Protocol = "http" // DefaultDaprHTTPPort is the default http port for Dapr DefaultDaprHTTPPort = 3500 // DefaultDaprGRPCPort is the default gRPC port for Dapr DefaultDaprGRPCPort = 50001 // DefaultProfilePort is the default port for profiling endpoints DefaultProfilePort = 7777 // DefaultMetricsPort is the default port for metrics endpoints DefaultMetricsPort = 9090 // DefaultComponentsPath is the default dir for Dapr components (standalone mode) DefaultComponentsPath = "./components" // DefaultAllowedOrigins is the default origins allowed for the Dapr HTTP servers DefaultAllowedOrigins = "*" )
const (
// HostIPEnvVar is the environment variable to override host's chosen IP address.
HostIPEnvVar = "DAPR_HOST_IP"
)
Variables ¶
This section is empty.
Functions ¶
func GetHostAddress ¶ added in v0.5.0
GetHostAddress selects a valid outbound IP address for the host.
Types ¶
type Config ¶
type Config struct { ID string HTTPPort int ProfilePort int EnableProfiling bool GRPCPort int ApplicationPort int ApplicationProtocol Protocol Mode modes.DaprMode PlacementServiceAddress string GlobalConfig string AllowedOrigins string Standalone config.StandaloneConfig Kubernetes config.KubernetesConfig MaxConcurrency int SentryServiceAddress string // contains filtered or unexported fields }
Config holds the Dapr Runtime configuration
func NewRuntimeConfig ¶
func NewRuntimeConfig(id, placementServiceAddress, controlPlaneAddress, allowedOrigins, globalConfig, componentsPath, appProtocol, mode string, httpPort, grpcPort, appPort, profilePort int, enableProfiling bool, maxConcurrency int, mtlsEnabled bool, sentryAddress string) *Config
NewRuntimeConfig returns a new runtime config
type DaprRuntime ¶
type DaprRuntime struct {
// contains filtered or unexported fields
}
DaprRuntime holds all the core components of the runtime
func FromFlags ¶ added in v0.4.0
func FromFlags() (*DaprRuntime, error)
FromFlags parses command flags and returns DaprRuntime instance
func NewDaprRuntime ¶
func NewDaprRuntime(runtimeConfig *Config, globalConfig *config.Configuration) *DaprRuntime
NewDaprRuntime returns a new runtime with the given runtime config and global config
func (*DaprRuntime) OnComponentUpdated ¶
func (a *DaprRuntime) OnComponentUpdated(component components_v1alpha1.Component)
OnComponentUpdated updates the Dapr runtime with new or changed components This method is invoked from the Dapr Control Plane whenever a component update happens
func (*DaprRuntime) Run ¶
func (a *DaprRuntime) Run(opts ...Option) error
Run performs initialization of the runtime with the runtime and global configurations
func (*DaprRuntime) Stop ¶
func (a *DaprRuntime) Stop()
Stop allows for a graceful shutdown of all runtime internal operations or components
type Option ¶ added in v0.4.0
type Option func(o *runtimeOpts)
Option is a function that customizes the runtime.
func WithExporters ¶ added in v0.4.0
WithExporters adds exporter components to the runtime.
func WithHTTPMiddleware ¶ added in v0.4.0
func WithHTTPMiddleware(httpMiddleware ...http.Middleware) Option
WithHTTPMiddleware adds HTTP middleware components to the runtime.
func WithInputBindings ¶ added in v0.4.0
func WithInputBindings(inputBindings ...bindings.InputBinding) Option
WithInputBindings adds input binding components to the runtime.
func WithOutputBindings ¶ added in v0.4.0
func WithOutputBindings(outputBindings ...bindings.OutputBinding) Option
WithOutputBindings adds output binding components to the runtime.
func WithPubSubs ¶ added in v0.4.0
WithPubSubs adds pubsub store components to the runtime.
func WithSecretStores ¶ added in v0.4.0
func WithSecretStores(secretStores ...secretstores.SecretStore) Option
WithSecretStores adds secret store components to the runtime.
func WithServiceDiscovery ¶ added in v0.4.0
func WithServiceDiscovery(serviceDiscoveries ...servicediscovery.ServiceDiscovery) Option
WithServiceDiscovery adds service discovery components to the runtime.
func WithStates ¶ added in v0.4.0
WithStates adds state store components to the runtime.