Documentation
¶
Index ¶
- Constants
- func Bind(cmd *cobra.Command, command Command, options BindOptions)
- func FindIntegrationDefinition(ctx CommandContext, name string) (openapi_client.IntegrationsIntegrationDefinition, error)
- func FormatCommandError(err error) error
- func OrganizationDomainType() openapi_client.AuthorizationDomainType
- func ParseIntegrationScopedName(name string) (string, string, bool)
- func ParseYamlResourceHeaders(raw []byte) (string, string, error)
- func ResolveCanvasID(ctx CommandContext, canvasID string) (string, error)
- func ResolveOrganizationID(ctx CommandContext) (string, error)
- func SplitUserIdentifier(positional string, emailFlag string) (string, string, error)
- type BindOptions
- type Command
- type CommandContext
- type ConfigContext
- type OutputFormat
- type Renderer
Constants ¶
const (
APIVersion = "v1"
)
Variables ¶
This section is empty.
Functions ¶
func FindIntegrationDefinition ¶
func FindIntegrationDefinition(ctx CommandContext, name string) (openapi_client.IntegrationsIntegrationDefinition, error)
func FormatCommandError ¶ added in v0.13.0
func OrganizationDomainType ¶ added in v0.17.0
func OrganizationDomainType() openapi_client.AuthorizationDomainType
OrganizationDomainType returns the authorization domain type used for all organization-scoped CLI requests. Packages should use this instead of referencing the openapi_client enum directly so the scoping rule lives in one place.
func ResolveCanvasID ¶ added in v0.9.0
func ResolveCanvasID(ctx CommandContext, canvasID string) (string, error)
func ResolveOrganizationID ¶ added in v0.15.0
func ResolveOrganizationID(ctx CommandContext) (string, error)
func SplitUserIdentifier ¶ added in v0.17.0
SplitUserIdentifier picks between a user id and a user email based on either a positional argument or a --email flag. A positional containing "@" is treated as an email, so CLI commands can accept either form in the positional slot.
Returns (userID, userEmail, error). Exactly one of userID/userEmail is non-empty on success when an identifier was provided. Both empty means no identifier was given. An error is returned when both a positional and an explicit --email flag were supplied (ambiguous).
Types ¶
type BindOptions ¶
type BindOptions struct {
NewAPIClient func() *openapi_client.APIClient
NewConfigContext func() ConfigContext
DefaultOutputFormat func() string
}
type Command ¶
type Command interface {
Execute(ctx CommandContext) error
}
type CommandContext ¶
type CommandContext struct {
Context context.Context
Cmd *cobra.Command
Args []string
Logger *log.Entry
API *openapi_client.APIClient
Renderer Renderer
Config ConfigContext
}
func NewCommandContext ¶
func NewCommandContext(cmd *cobra.Command, args []string, options BindOptions) (CommandContext, error)
func (CommandContext) IsInteractive ¶ added in v0.14.0
func (c CommandContext) IsInteractive() bool
IsInteractive returns true when stdin is a terminal, meaning the user can respond to interactive prompts.
type ConfigContext ¶ added in v0.9.0
* Interface that allows commands to access * and update the current configuration context.
type OutputFormat ¶
type OutputFormat string
const ( OutputFormatText OutputFormat = "text" OutputFormatJSON OutputFormat = "json" OutputFormatYAML OutputFormat = "yaml" )