app

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 58 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VersionHeader                 = "tcld-version"
	CommitHeader                  = "tcld-commit"
	TemporalCloudAPIVersionHeader = "temporal-cloud-api-version"
	TemporalCloudAPIVersion       = "2024-03-18-00"
)
View Source
const (
	ServerFlagName             = "server"
	ConfigDirFlagName          = "config-dir"
	RetentionDaysFlagName      = "retention-days"
	NamespaceFlagName          = "namespace"
	RequestIDFlagName          = "request-id"
	ResourceVersionFlagName    = "resource-version"
	APIKeyFlagName             = "api-key"
	InsecureConnectionFlagName = "insecure"
	EnableDebugLogsFlagName    = "enable-debug-logs"
	AuthenticationFlagCategory = "Authentication:"

	// APIKeyVersionTag indicates the state of API keys. This should be removed when fully released.
	APIKeyVersionTag = "preview"
)
View Source
const (
	CaCertificateFlagName     = "ca-certificate"
	CaCertificateFileFlagName = "ca-certificate-file"
)
View Source
const (
	AuthMethodRestricted   = "restricted"
	AuthMethodMTLS         = "mtls"
	AuthMethodAPIKey       = "api_key"
	AuthMethodAPIKeyOrMTLS = "api_key_or_mtls"
)
View Source
const (
	// MinSupportedVersion is the minimum tcld version supported by our APIs.
	// This string must be updated when we deprecate older versions, but should be
	// done carefully as this will likely break user's current usage of tcld.
	MinSupportedVersion = "v0.1.3"

	// DefaultVersionString is the version which is sent over if no version was available.
	// This can happen if a user builds the latest main branch, as the version string provided
	// to us from Go tooling is `(devel)`.
	DefaultVersionString = MinSupportedVersion + "+no-version-available"
)
View Source
const (
	AutoConfirmFlagName = "auto_confirm"
)

Variables

View Source
var (
	GCPSinkFeatureFlag        = "enable-gcp-sink"
	ServiceAccountFeatureFlag = "enable-service-account"
)
View Source
var (
	ServerFlag = &cli.StringFlag{
		Name:     ServerFlagName,
		Aliases:  []string{"s"},
		Value:    "saas-api.tmprl.cloud:443",
		Usage:    "saas-api server endpoint",
		EnvVars:  []string{"TEMPORAL_CLOUD_API_SERVER"},
		Hidden:   true,
		Required: false,
	}
	ConfigDirFlag = &cli.PathFlag{
		Name:     ConfigDirFlagName,
		Value:    filepath.Join(os.Getenv("HOME"), ".config", "tcld"),
		Usage:    "The config directory to use",
		EnvVars:  []string{"TEMPORAL_CLOUD_CONFIG_DIR"},
		Hidden:   true,
		Required: false,
	}
	RetentionDaysFlag = &cli.IntFlag{
		Name:     RetentionDaysFlagName,
		Usage:    "The retention of the namespace in days",
		Aliases:  []string{"rd"},
		EnvVars:  []string{"NAMESPACE_RETENTION"},
		Required: true,
	}
	NamespaceFlag = &cli.StringFlag{
		Name:     NamespaceFlagName,
		Usage:    "The namespace hosted on temporal cloud",
		Aliases:  []string{"n"},
		EnvVars:  []string{"TEMPORAL_CLOUD_NAMESPACE"},
		Required: true,
	}
	RequestIDFlag = &cli.StringFlag{
		Name:    RequestIDFlagName,
		Usage:   "The request-id to use for the asynchronous operation, if not set the server will assign one (optional)",
		Aliases: []string{"r"},
	}
	ResourceVersionFlag = &cli.StringFlag{
		Name:    ResourceVersionFlagName,
		Usage:   "The resource-version (etag) to update from, if not set the cli will use the latest (optional)",
		Aliases: []string{"v"},
	}
	APIKeyFlag = &cli.StringFlag{
		Name:     APIKeyFlagName,
		Usage:    "The API Key used for authentication (" + APIKeyVersionTag + ")",
		EnvVars:  []string{"TEMPORAL_CLOUD_API_KEY"},
		Category: AuthenticationFlagCategory,
	}
	InsecureConnectionFlag = &cli.BoolFlag{
		Name:     InsecureConnectionFlagName,
		Usage:    "Use an insecure transport for connection, recommended to avoid this option unless necessary",
		EnvVars:  []string{"TEMPORAL_CLOUD_INSECURE_CONNECTION"},
		Category: AuthenticationFlagCategory,

		Hidden: true,
	}
	EnableDebugLogsFlag = &cli.BoolFlag{
		Name:    EnableDebugLogsFlagName,
		Usage:   "A flag to enable debug logs",
		EnvVars: []string{"TEMPORAL_CLOUD_ENABLE_DEBUG_LOGS"},
	}
)
View Source
var (
	CaCertificateFlag = &cli.StringFlag{
		Name:    CaCertificateFlagName,
		Usage:   "The base64 encoded ca certificate",
		Aliases: []string{"c"},
	}
	CaCertificateFileFlag = &cli.PathFlag{
		Name:    CaCertificateFileFlagName,
		Usage:   "The path to the ca pem file",
		Aliases: []string{"f"},
	}
)
View Source
var (
	AutoConfirmFlag = &cli.BoolFlag{
		Name:    AutoConfirmFlagName,
		Usage:   "Automatically confirm all prompts",
		EnvVars: []string{"AUTO_CONFIRM"},
	}
)

Functions

func ConfirmPrompt added in v0.1.3

func ConfirmPrompt(ctx *cli.Context, msg string) (bool, error)

func FormatJson

func FormatJson(i interface{}) (string, error)

func GetServerConnection

func GetServerConnection(c *cli.Context, opts ...grpc.DialOption) (context.Context, *grpc.ClientConn, error)

func IsFeatureEnabled added in v0.8.0

func IsFeatureEnabled(feature string) bool

func NewApp

func NewApp(params AppParams) (*cli.App, error)

func PrintObj

func PrintObj(i interface{}) error

func PrintProto

func PrintProto(m proto.Message) error

func PrintProtoSlice added in v0.6.0

func PrintProtoSlice(name string, ms []proto.Message) error

func ReadCACerts added in v0.1.4

func ReadCACerts(ctx *cli.Context) (string, error)

ReadCACerts reads ca certs based on cli flags.

func ReadCACertsRequired added in v0.22.0

func ReadCACertsRequired(ctx *cli.Context, required bool) (string, error)

func ReadCertFilters added in v0.5.0

func ReadCertFilters(ctx *cli.Context) ([]byte, error)

Types

type APIKeyClient added in v0.11.0

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

func GetAPIKeyClient added in v0.11.0

func GetAPIKeyClient(ctx *cli.Context) (*APIKeyClient, error)

type AccountClient added in v0.1.5

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

func GetAccountClient added in v0.1.5

func GetAccountClient(ctx *cli.Context) (*AccountClient, error)

func NewAccountClient added in v0.1.5

func NewAccountClient(ctx context.Context, conn *grpc.ClientConn) *AccountClient

type AppParams

type AppParams struct {
	fx.In
	Commands []*cli.Command `group:"commands"`
}

type BuildInfo added in v0.14.0

type BuildInfo struct {
	Date    string // build time or commit time.
	Commit  string
	Version string
}

func NewBuildInfo added in v0.14.0

func NewBuildInfo() BuildInfo

NewBuildInfo will populate build info, to make debugging API errors easier, in the three scenarios a user can install tcld:

  1. Installed via the makefile or via brew.
  2. Installed via `go install`.
  3. Compiled on a branch via `go build ./cmd/tcld`

type CommandOut

type CommandOut struct {
	fx.Out
	Command *cli.Command `group:"commands"`
}

func NewAPIKeyCommand added in v0.11.0

func NewAPIKeyCommand(getAPIKeyClientFn GetAPIKeyClientFn) (CommandOut, error)

func NewAccountCommand added in v0.1.5

func NewAccountCommand(getAccountClientFn GetAccountClientFn) (CommandOut, error)

func NewCertificatesCommand added in v0.7.0

func NewCertificatesCommand() (CommandOut, error)

func NewFeatureCommand added in v0.8.0

func NewFeatureCommand() (CommandOut, error)

func NewLoginCommand

func NewLoginCommand(c *LoginClient) (CommandOut, error)

func NewLogoutCommand added in v0.1.7

func NewLogoutCommand(c *LoginClient) (CommandOut, error)

func NewNamespaceCommand

func NewNamespaceCommand(getNamespaceClientFn GetNamespaceClientFn) (CommandOut, error)

func NewRequestCommand

func NewRequestCommand(getRequestClientFn GetRequestClientFn) (CommandOut, error)

func NewServiceAccountCommand added in v0.18.0

func NewServiceAccountCommand(getServiceAccountClientFn GetServiceAccountClientFn) (CommandOut, error)

func NewUserCommand added in v0.6.0

func NewUserCommand(getUserClientFn GetUserClientFn) (CommandOut, error)

func NewVersionCommand

func NewVersionCommand() (CommandOut, error)

type FeatureFlag added in v0.8.0

type FeatureFlag struct {
	Name  string `json:"Name"`
	Value bool   `json:"Value"`
}

type GetAPIKeyClientFn added in v0.11.0

type GetAPIKeyClientFn func(ctx *cli.Context) (*APIKeyClient, error)

type GetAccountClientFn added in v0.1.5

type GetAccountClientFn func(ctx *cli.Context) (*AccountClient, error)

type GetNamespaceClientFn

type GetNamespaceClientFn func(ctx *cli.Context) (*NamespaceClient, error)

type GetRequestClientFn

type GetRequestClientFn func(ctx *cli.Context) (*RequestClient, error)

type GetServiceAccountClientFn added in v0.18.0

type GetServiceAccountClientFn func(ctx *cli.Context) (*ServiceAccountClient, error)

type GetUserClientFn added in v0.6.0

type GetUserClientFn func(ctx *cli.Context) (*UserClient, error)

type LoginClient

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

func GetLoginClient

func GetLoginClient() *LoginClient

type NamespaceClient

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

func GetNamespaceClient

func GetNamespaceClient(ctx *cli.Context) (*NamespaceClient, error)

func NewNamespaceClient added in v0.1.5

func NewNamespaceClient(ctx context.Context, conn *grpc.ClientConn) *NamespaceClient

type OAuthDeviceCodeResponse added in v0.8.0

type OAuthDeviceCodeResponse struct {
	DeviceCode              string `json:"device_code"`
	UserCode                string `json:"user_code"`
	VerificationURI         string `json:"verification_uri"`
	VerificationURIComplete string `json:"verification_uri_complete"`
	ExpiresIn               int    `json:"expires_in"`
	Interval                int    `json:"interval"`
}

type OAuthTokenResponse added in v0.8.0

type OAuthTokenResponse struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	IDToken      string `json:"id_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int    `json:"expires_in"`
}

type Release added in v0.21.0

type Release struct {
	TagName string `json:"tag_name"`
}

type RequestClient

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

func GetRequestClient

func GetRequestClient(ctx *cli.Context) (*RequestClient, error)

func NewRequestClient added in v0.1.5

func NewRequestClient(ctx context.Context, conn *grpc.ClientConn) *RequestClient

type ServiceAccountClient added in v0.18.0

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

func GetServiceAccountClient added in v0.18.0

func GetServiceAccountClient(ctx *cli.Context) (*ServiceAccountClient, error)

type UserClient added in v0.6.0

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

func GetUserClient added in v0.6.0

func GetUserClient(ctx *cli.Context) (*UserClient, error)

Directories

Path Synopsis
credentials

Jump to

Keyboard shortcuts

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