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" // 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 ¶
func GetBuildInfo ¶
GetBuildInfo returns build info for the CLI and the local Dapr runtime.
func GetCLIPIDCountMap ¶
func GetCLIPIDCountMap(apps []ListOutput) map[int]int
GetCLIPIDCountMap returns a map of CLI PIDs to number of apps started with it.
func GetDaprComponentsPath ¶
func GetDaprConfigPath ¶
func GetDaprRuntimePath ¶
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 ¶
GetDashboardVersion returns the version for the local Dapr dashboard.
func GetRuntimeVersion ¶
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) error
Init installs Dapr on a local machine using the supplied runtimeVersion.
func NewDashboardCmd ¶
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 ¶
StopAppsWithRunFile terminates the daprd and application processes with the given run file.
Types ¶
type Client ¶
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 ¶
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 ¶
type LogDestType string
const ( Console LogDestType = "console" File LogDestType = "file" FileAndConsole LogDestType = "fileAndConsole" DefaultDaprdLogDest = File DefaultAppLogDest = FileAndConsole )
func (LogDestType) IsValid ¶
func (l LogDestType) IsValid() error
func (LogDestType) String ¶
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 ¶
func (*RunConfig) SetDefaultFromSchema ¶
func (config *RunConfig) SetDefaultFromSchema()
func (*RunConfig) ValidateK8s ¶
type SharedRunConfig ¶
type SharedRunConfig struct { // Specifically omitted from annotations see https://github.com/halokid/daprcli/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/halokid/daprcli/issues/1324 . }
SharedRunConfig represents the application configuration parameters, which can be shared across many apps.