standalone

package
v1.8.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: Apache-2.0 Imports: 38 Imported by: 7

Documentation

Index

Constants

View Source
const (

	// DaprPlacementContainerName is the container name of placement service.
	DaprPlacementContainerName = "dapr_placement"
	// DaprRedisContainerName is the container name of redis.
	DaprRedisContainerName = "dapr_redis"
	// DaprZipkinContainerName is the container name of zipkin.
	DaprZipkinContainerName = "dapr_zipkin"
)
View Source
const SocketFormat = "/tmp/dapr-%s-http.socket"

Variables

This section is empty.

Functions

func DefaultComponentsDirPath added in v0.9.0

func DefaultComponentsDirPath() string

func DefaultConfigFilePath added in v0.9.0

func DefaultConfigFilePath() string

func GetBuildInfo added in v1.3.0

func GetBuildInfo(version string) string

GetBuildInfo returns build info for the CLI and the local Dapr runtime.

func GetDashboardVersion added in v0.10.0

func GetDashboardVersion() string

GetDashboardVersion returns the version for the local Dapr dashboard.

func GetRuntimeVersion added in v0.10.0

func GetRuntimeVersion() string

GetRuntimeVersion returns the version for the local Dapr runtime.

func Init

func Init(runtimeVersion, dashboardVersion string, dockerNetwork string, slimMode bool, imageRegistryURL string, fromDir string) error

Init installs Dapr on a local machine using the supplied runtimeVersion.

func NewDashboardCmd added in v0.11.0

func NewDashboardCmd(port int) *exec.Cmd

NewDashboardCmd creates the command to run dashboard.

func Stop

func Stop(appID string) error

Stop terminates the application process.

func Uninstall

func Uninstall(uninstallAll bool, dockerNetwork string) error

Uninstall reverts all changes made by init. Deletes all installed containers, removes default dapr folder, removes the installed binary and unsets env variables.

Types

type Client added in v1.0.0

type Client interface {
	// Invoke is a command to invoke a remote or local dapr instance.
	Invoke(appID, method string, data []byte, verb string, socket string) (string, error)
	// Publish is used to publish event to a topic in a pubsub for an app ID.
	Publish(publishAppID, pubsubName, topic string, payload []byte, socket string) error
}

Client is the interface the wraps all the methods exposed by the Dapr CLI.

func NewClient added in v1.0.0

func NewClient() Client

type DaprMeta added in v1.6.0

type DaprMeta struct {
	ExistingIDs   map[string]bool
	ExistingPorts map[int]bool
}

type DaprProcess added in v1.0.0

type DaprProcess interface {
	List() ([]ListOutput, error)
}

type ListOutput

type ListOutput struct {
	AppID          string `csv:"APP ID"    json:"appId"          yaml:"appId"`
	HTTPPort       int    `csv:"HTTP PORT" json:"httpPort"       yaml:"httpPort"`
	GRPCPort       int    `csv:"GRPC PORT" json:"grpcPort"       yaml:"grpcPort"`
	AppPort        int    `csv:"APP PORT"  json:"appPort"        yaml:"appPort"`
	MetricsEnabled bool   `csv:"-"         json:"metricsEnabled" yaml:"metricsEnabled"` // Not displayed in table, consumed by dashboard.
	Command        string `csv:"COMMAND"   json:"command"        yaml:"command"`
	Age            string `csv:"AGE"       json:"age"            yaml:"age"`
	Created        string `csv:"CREATED"   json:"created"        yaml:"created"`
	PID            int    `csv:"PID"       json:"pid"            yaml:"pid"`
}

ListOutput represents the application ID, application port and creation time.

func List

func List() ([]ListOutput, error)

List outputs all the applications.

type RunConfig

type RunConfig struct {
	AppID              string `env:"APP_ID" arg:"app-id"`
	AppPort            int    `env:"APP_PORT" arg:"app-port"`
	HTTPPort           int    `env:"DAPR_HTTP_PORT" arg:"dapr-http-port"`
	GRPCPort           int    `env:"DAPR_GRPC_PORT" arg:"dapr-grpc-port"`
	ConfigFile         string `arg:"config"`
	Protocol           string `arg:"app-protocol"`
	Arguments          []string
	EnableProfiling    bool   `arg:"enable-profiling"`
	ProfilePort        int    `arg:"profile-port"`
	LogLevel           string `arg:"log-level"`
	MaxConcurrency     int    `arg:"app-max-concurrency"`
	PlacementHostAddr  string `arg:"placement-host-address"`
	ComponentsPath     string `arg:"components-path"`
	AppSSL             bool   `arg:"app-ssl"`
	MetricsPort        int    `env:"DAPR_METRICS_PORT" arg:"metrics-port"`
	MaxRequestBodySize int    `arg:"dapr-http-max-request-size"`
	HTTPReadBufferSize int    `arg:"dapr-http-read-buffer-size"`
	UnixDomainSocket   string `arg:"unix-domain-socket"`
	EnableAPILogging   bool   `arg:"enable-api-logging"`
}

RunConfig represents the application configuration parameters.

type RunOutput

type RunOutput struct {
	DaprCMD      *exec.Cmd
	DaprErr      error
	DaprHTTPPort int
	DaprGRPCPort int
	AppID        string
	AppCMD       *exec.Cmd
	AppErr       error
}

RunOutput represents the run output.

func Run

func Run(config *RunConfig) (*RunOutput, error)

type Standalone added in v1.0.0

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

func (*Standalone) Invoke added in v1.0.0

func (s *Standalone) Invoke(appID, method string, data []byte, verb string, path string) (string, error)

Invoke is a command to invoke a remote or local dapr instance.

func (*Standalone) Publish added in v1.0.0

func (s *Standalone) Publish(publishAppID, pubsubName, topic string, payload []byte, socket string) error

Publish publishes payload to topic in pubsub referenced by pubsubName.

Jump to

Keyboard shortcuts

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