Documentation
¶
Overview ¶
Package cli provides command-line interface functionality for SolidPing.
Index ¶
- Variables
- func GetCommands() []*cli.Command
- func GetGlobalFlags() []cli.Flag
- type Context
- func (c *Context) GetClient(_ context.Context) (*apihelper.Helper, error)
- func (c *Context) GetOrg() string
- func (c *Context) HandleAuthError(err error) error
- func (c *Context) HandleError(msg string, err error) error
- func (c *Context) HandleStatusError(msg string, statusCode int) error
- func (c *Context) IsText() bool
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrManifestRequired is returned when no manifest file is supplied. ErrManifestRequired = errors.New("a manifest file is required (-f/--file)") // ErrApplyAborted is returned when the user declines the apply prompt. ErrApplyAborted = errors.New("apply aborted") )
View Source
var ( // ErrCheckNotFound is returned when a check is not found. ErrCheckNotFound = errors.New("check not found") // ErrFailedToListChecks is returned when listing checks fails. ErrFailedToListChecks = errors.New("failed to list checks") // ErrFailedToCreateCheck is returned when creating a check fails. ErrFailedToCreateCheck = errors.New("failed to create check") // ErrFailedToRemoveCheck is returned when removing a check fails. ErrFailedToRemoveCheck = errors.New("failed to remove check") // ErrAPIError is returned when an API call fails. ErrAPIError = errors.New("API error") )
View Source
var ( // ErrServerUnhealthy is returned when the server is unhealthy. ErrServerUnhealthy = errors.New("server is unhealthy") // ErrFailedToGetVersion is returned when getting version fails. ErrFailedToGetVersion = errors.New("failed to get version") )
Functions ¶
func GetGlobalFlags ¶
GetGlobalFlags returns the global flags available for all commands.
Types ¶
type Context ¶
type Context struct {
Config *config.Config
APIHelper *apihelper.Helper
Outputter output.Outputter
OutputFormat output.Format
Verbose bool
}
Context holds the context for CLI commands.
func NewCLIContext ¶
NewCLIContext creates a new CLI context from command flags.
func (*Context) HandleAuthError ¶
HandleAuthError handles authentication errors consistently across output formats.
func (*Context) HandleError ¶
HandleError handles general errors consistently across output formats.
func (*Context) HandleStatusError ¶
HandleStatusError handles unexpected HTTP status code errors.
Source Files
¶
- apply.go
- auth.go
- auth_device.go
- auth_selfservice.go
- channels.go
- check_groups.go
- checks.go
- checks_deps.go
- checks_detail.go
- checks_diff.go
- checks_more.go
- checks_yaml.go
- commands.go
- constants.go
- context.go
- discovery.go
- email_suppressions.go
- entitlements.go
- escalation_policies.go
- events.go
- files.go
- flags.go
- heartbeat.go
- incidents.go
- invitations.go
- jobs.go
- maintenance.go
- members.go
- membership_requests.go
- notification_contacts.go
- notification_routes.go
- notifications.go
- oncall.go
- orgs.go
- results.go
- server.go
- severities.go
- statuspages.go
- statusupdates.go
- system.go
- taxonomy.go
- tokens.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package apihelper provides helper functions for API client operations.
|
Package apihelper provides helper functions for API client operations. |
|
Package config provides configuration management for the CLI.
|
Package config provides configuration management for the CLI. |
|
Package output provides output formatting utilities for CLI commands.
|
Package output provides output formatting utilities for CLI commands. |
Click to show internal directories.
Click to hide internal directories.