Documentation ¶
Index ¶
- Constants
- func GetAppCommand(config *RunConfig) *exec.Cmd
- func GetBuildInfo(inputInstallPath string, version string) (string, error)
- func GetCLIPIDCountMap(apps []ListOutput) map[int]int
- func GetDaprCommand(config *RunConfig) (*exec.Cmd, error)
- func GetDaprComponentsPath(daprDir string) string
- func GetDaprConfigPath(daprDir string) string
- func GetDaprRuntimePath(daprRuntimePath string) (string, error)
- func GetDashboardVersion(inputInstallPath string) (string, error)
- func GetRuntimeVersion(inputInstallPath string) (string, error)
- func Init(runtimeVersion, dashboardVersion string, dockerNetwork string, slimMode bool, ...) error
- func NewDashboardCmd(inputInstallPath string, port int) (*exec.Cmd, error)
- func Stop(appID string, cliPIDToNoOfApps map[int]int, apps []ListOutput) error
- func StopAppsWithRunFile(runTemplatePath string) error
- func Uninstall(uninstallAll bool, dockerNetwork string, containerRuntime string, ...) error
- type Client
- type DaprMeta
- type DaprProcess
- type ListOutput
- type LogDestType
- type RunConfig
- type SharedRunConfig
- type Standalone
Constants ¶
const ( DefaultDaprDirName = ".dapr" DefaultConfigFileName = "config.yaml" DefaultResourcesDirName = "resources" )
const ( // DaprPlacementContainerName is the container name of placement service. DaprPlacementContainerName = "dapr_placement" // DaprSchedulerContainerName is the container name of scheduler service. DaprSchedulerContainerName = "dapr_scheduler" // DaprRedisContainerName is the container name of redis. DaprRedisContainerName = "dapr_redis" // DaprZipkinContainerName is the container name of zipkin. DaprZipkinContainerName = "dapr_zipkin" )
const SocketFormat = "/tmp/dapr-%s-http.socket"
Variables ¶
This section is empty.
Functions ¶
func GetAppCommand ¶ added in v1.10.0
func GetBuildInfo ¶ added in v1.3.0
GetBuildInfo returns build info for the CLI and the local Dapr runtime.
func GetCLIPIDCountMap ¶ added in v1.10.0
func GetCLIPIDCountMap(apps []ListOutput) map[int]int
GetCLIPIDCountMap returns a map of CLI PIDs to number of apps started with it.
func GetDaprComponentsPath ¶ added in v1.10.0
func GetDaprConfigPath ¶ added in v1.10.0
func GetDaprRuntimePath ¶ added in v1.10.0
GetDaprRuntimePath returns the dapr runtime installation path. daprRuntimePath is based on the --runtime-path command line flag. The order of precedence is:
- From --runtime-path command line flag appended with `.dapr`
- From DAPR_RUNTIME_PATH environment variable appended with `.dapr`
- default $HOME/.dapr
func GetDashboardVersion ¶ added in v0.10.0
GetDashboardVersion returns the version for the local Dapr dashboard.
func GetRuntimeVersion ¶ added in v0.10.0
GetRuntimeVersion returns the version for the local Dapr runtime.
func Init ¶
func Init(runtimeVersion, dashboardVersion string, dockerNetwork string, slimMode bool, imageRegistryURL string, fromDir string, containerRuntime string, imageVariant string, daprInstallPath string, schedulerVolume *string) error
Init installs Dapr on a local machine using the supplied runtimeVersion.
func NewDashboardCmd ¶ added in v0.11.0
NewDashboardCmd creates the command to run dashboard.
func Stop ¶
func Stop(appID string, cliPIDToNoOfApps map[int]int, apps []ListOutput) error
Stop terminates the application process.
func StopAppsWithRunFile ¶ added in v1.10.0
StopAppsWithRunFile terminates the daprd and application processes with the given run file.
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, metadata map[string]interface{}) error }
Client is the interface the wraps all the methods exposed by the Dapr CLI.
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"` DaprdPID int `csv:"DAPRD PID" json:"daprdPid" yaml:"daprdPid"` CliPID int `csv:"CLI PID" json:"cliPid" yaml:"cliPid"` AppPID int `csv:"APP PID" json:"appPid" yaml:"appPid"` MaxRequestBodySize int `csv:"-" json:"maxRequestBodySize" yaml:"maxRequestBodySize"` // Additional field, not displayed in table. HTTPReadBufferSize int `csv:"-" json:"httpReadBufferSize" yaml:"httpReadBufferSize"` // Additional field, not displayed in table. RunTemplatePath string `csv:"RUN_TEMPLATE_PATH" json:"runTemplatePath" yaml:"runTemplatePath"` AppLogPath string `csv:"APP_LOG_PATH" json:"appLogPath" yaml:"appLogPath"` DaprDLogPath string `csv:"DAPRD_LOG_PATH" json:"daprdLogPath" yaml:"daprdLogPath"` RunTemplateName string `json:"runTemplateName" yaml:"runTemplateName"` // specifically omitted in csv output. }
ListOutput represents the application ID, application port and creation time.
type LogDestType ¶ added in v1.11.0
type LogDestType string
const ( Console LogDestType = "console" File LogDestType = "file" FileAndConsole LogDestType = "fileAndConsole" DefaultDaprdLogDest = File DefaultAppLogDest = FileAndConsole )
func (LogDestType) IsValid ¶ added in v1.11.0
func (l LogDestType) IsValid() error
func (LogDestType) String ¶ added in v1.11.0
func (l LogDestType) String() string
type RunConfig ¶
type RunConfig struct { AppID string `env:"APP_ID" arg:"app-id" annotation:"dapr.io/app-id" yaml:"appID"` AppChannelAddress string `env:"APP_CHANNEL_ADDRESS" arg:"app-channel-address" ifneq:"127.0.0.1" yaml:"appChannelAddress"` AppPort int `env:"APP_PORT" arg:"app-port" annotation:"dapr.io/app-port" yaml:"appPort" default:"-1"` HTTPPort int `env:"DAPR_HTTP_PORT" arg:"dapr-http-port" yaml:"daprHTTPPort" default:"-1"` GRPCPort int `env:"DAPR_GRPC_PORT" arg:"dapr-grpc-port" yaml:"daprGRPCPort" default:"-1"` ProfilePort int `arg:"profile-port" yaml:"profilePort" default:"-1"` Command []string `yaml:"command"` MetricsPort int `env:"DAPR_METRICS_PORT" arg:"metrics-port" annotation:"dapr.io/metrics-port" yaml:"metricsPort" default:"-1"` UnixDomainSocket string `arg:"unix-domain-socket" annotation:"dapr.io/unix-domain-socket-path" yaml:"unixDomainSocket"` InternalGRPCPort int `arg:"dapr-internal-grpc-port" yaml:"daprInternalGRPCPort" default:"-1"` }
RunConfig represents the application configuration parameters.
func (*RunConfig) GetAnnotations ¶ added in v1.12.0
func (*RunConfig) SetDefaultFromSchema ¶ added in v1.10.0
func (config *RunConfig) SetDefaultFromSchema()
func (*RunConfig) ValidateK8s ¶ added in v1.12.0
type SharedRunConfig ¶ added in v1.10.0
type SharedRunConfig struct { // Specifically omitted from annotations see https://github.com/dapr/cli/issues/1324 PlacementHostAddr string `arg:"placement-host-address" yaml:"placementHostAddress"` ComponentsPath string `arg:"components-path"` // Deprecated in run template file: use ResourcesPaths instead. ResourcesPath string `yaml:"resourcesPath"` // Deprecated in run template file: use ResourcesPaths instead. ResourcesPaths []string `arg:"resources-path" yaml:"resourcesPaths"` // Speicifcally omitted from annotations as appSSL is deprecated. // Specifically omitted from annotations see https://github.com/dapr/cli/issues/1324 . }
SharedRunConfig represents the application configuration parameters, which can be shared across many apps.
type Standalone ¶ added in v1.0.0
type Standalone struct {
// contains filtered or unexported fields
}