runtime

package
v1.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2022 License: Apache-2.0 Imports: 74 Imported by: 12

Documentation

Index

Constants

View Source
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
	// DefaultDaprPublicPort is the default http port for Dapr.
	DefaultDaprPublicPort = 3501
	// DefaultDaprAPIGRPCPort is the default API gRPC port for Dapr.
	DefaultDaprAPIGRPCPort = 50001
	// DefaultProfilePort is the default port for profiling endpoints.
	DefaultProfilePort = 7777
	// DefaultMetricsPort is the default port for metrics endpoints.
	DefaultMetricsPort = 9090
	// DefaultMaxRequestBodySize is the default option for the maximum body size in MB for Dapr HTTP servers.
	DefaultMaxRequestBodySize = 4
	// DefaultAPIListenAddress is which address to listen for the Dapr HTTP and GRPC APIs. Empty string is all addresses.
	DefaultAPIListenAddress = ""
	// DefaultReadBufferSize is the default option for the maximum header size in KB for Dapr HTTP servers.
	DefaultReadBufferSize = 4
)

Variables

View Source
var ErrUnexpectedEnvelopeData = errors.New("unexpected data type encountered in envelope")

ErrUnexpectedEnvelopeData denotes that an unexpected data type was encountered when processing a cloud event's data property.

Functions

This section is empty.

Types

type ComponentCategory added in v0.11.0

type ComponentCategory string

type ComponentRegistry added in v1.5.0

type ComponentRegistry struct {
	Actors          actors.Actors
	DirectMessaging messaging.DirectMessaging
	StateStores     map[string]state.Store
	InputBindings   map[string]bindings.InputBinding
	OutputBindings  map[string]bindings.OutputBinding
	SecretStores    map[string]secretstores.SecretStore
	PubSubs         map[string]pubsub.PubSub
}

type ComponentsCallback added in v1.5.0

type ComponentsCallback func(components ComponentRegistry) error

type Config

type Config struct {
	ID                  string
	HTTPPort            int
	PublicPort          *int
	ProfilePort         int
	EnableProfiling     bool
	APIGRPCPort         int
	InternalGRPCPort    int
	ApplicationPort     int
	APIListenAddresses  []string
	ApplicationProtocol Protocol
	Mode                modes.DaprMode
	PlacementAddresses  []string
	GlobalConfig        string
	AllowedOrigins      string
	Standalone          config.StandaloneConfig
	Kubernetes          config.KubernetesConfig
	MaxConcurrency      int

	SentryServiceAddress     string
	CertChain                *credentials.CertChain
	AppSSL                   bool
	MaxRequestBodySize       int
	UnixDomainSocket         string
	ReadBufferSize           int
	StreamRequestBody        bool
	GracefulShutdownDuration time.Duration
	// contains filtered or unexported fields
}

Config holds the Dapr Runtime configuration.

func NewRuntimeConfig

func NewRuntimeConfig(
	id string, placementAddresses []string,
	controlPlaneAddress, allowedOrigins, globalConfig, componentsPath, appProtocol, mode string,
	httpPort, internalGRPCPort, apiGRPCPort int, apiListenAddresses []string, publicPort *int, appPort, profilePort int,
	enableProfiling bool, maxConcurrency int, mtlsEnabled bool, sentryAddress string, appSSL bool, maxRequestBodySize int, unixDomainSocket string, readBufferSize int, streamRequestBody bool, gracefulShutdownDuration time.Duration) *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, accessControlList *config.AccessControlList) *DaprRuntime

NewDaprRuntime returns a new runtime with the given runtime config and global config.

func (*DaprRuntime) GetPubSub added in v1.0.0

func (a *DaprRuntime) GetPubSub(pubsubName string) pubsub.PubSub

GetPubSub is an adapter method to find a pubsub by name.

func (*DaprRuntime) Publish added in v0.6.0

func (a *DaprRuntime) Publish(req *pubsub.PublishRequest) error

Publish is an adapter method for the runtime to pre-validate publish requests And then forward them to the Pub/Sub component. This method is used by the HTTP and gRPC APIs.

func (*DaprRuntime) Run

func (a *DaprRuntime) Run(opts ...Option) error

Run performs initialization of the runtime with the runtime and global configurations.

func (*DaprRuntime) Shutdown added in v1.5.0

func (a *DaprRuntime) Shutdown(duration time.Duration)

func (*DaprRuntime) ShutdownWithWait added in v1.1.0

func (a *DaprRuntime) ShutdownWithWait()

ShutdownWithWait will gracefully stop runtime and wait outstanding operations.

func (*DaprRuntime) WaitUntilShutdown added in v1.5.0

func (a *DaprRuntime) WaitUntilShutdown() error

type Option added in v0.4.0

type Option func(o *runtimeOpts)

Option is a function that customizes the runtime.

func WithComponentsCallback added in v1.5.0

func WithComponentsCallback(componentsCallback ComponentsCallback) Option

WithComponentsCallback sets the components callback for applications that embed Dapr.

func WithConfigurations added in v1.5.0

func WithConfigurations(configurations ...configuration.Configuration) Option

WithConfigurations adds configuration store 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 WithNameResolutions added in v0.9.0

func WithNameResolutions(nameResolutions ...nameresolution.NameResolution) Option

WithNameResolutions adds name resolution 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

func WithPubSubs(pubsubs ...pubsub.PubSub) Option

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 WithStates added in v0.4.0

func WithStates(states ...state.State) Option

WithStates adds state store components to the runtime.

type Protocol

type Protocol string

Protocol is a communications protocol.

type Route added in v1.0.0

type Route struct {
	// contains filtered or unexported fields
}

type TopicRoute added in v0.10.0

type TopicRoute struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL