Documentation
¶
Index ¶
- Variables
- func BuildQueryString(params map[string]string) string
- func FormatTimeAgo(t time.Time) string
- func PaginationQuery(cmd *cli.Command) string
- func ShowDetail(w io.Writer, data gjson.Result)
- func ShowJSON(out *os.File, raw string, format string, transform string) error
- func ShowResult(out *os.File, res gjson.Result, format string, transform string) error
- type APIError
- type CLIConfig
- type Client
- func (c *Client) Delete(ctx context.Context, path string) (gjson.Result, error)
- func (c *Client) DeleteWithBody(ctx context.Context, path string, jsonBody []byte) (gjson.Result, error)
- func (c *Client) Do(ctx context.Context, method, path string, body io.Reader) (gjson.Result, error)
- func (c *Client) DoRaw(ctx context.Context, method, path string) ([]byte, string, error)
- func (c *Client) Get(ctx context.Context, path string) (gjson.Result, error)
- func (c *Client) PatchJSON(ctx context.Context, path string, jsonBody []byte) (gjson.Result, error)
- func (c *Client) Post(ctx context.Context, path string, jsonBody string) (gjson.Result, error)
- func (c *Client) PostJSON(ctx context.Context, path string, jsonBody []byte) (gjson.Result, error)
- func (c *Client) Put(ctx context.Context, path string, jsonBody string) (gjson.Result, error)
- func (c *Client) PutJSON(ctx context.Context, path string, jsonBody []byte) (gjson.Result, error)
- type ProfileConfig
- type TableWriter
Constants ¶
This section is empty.
Variables ¶
View Source
var Command *cli.Command
View Source
var OutputFormats = []string{"auto", "json", "jsonline", "pretty", "raw", "yaml"}
View Source
var PaginationFlags = []cli.Flag{ &cli.IntFlag{ Name: "limit", Usage: "Maximum number of results to return", Value: 20, }, &cli.IntFlag{ Name: "offset", Usage: "Number of results to skip", Value: 0, }, }
View Source
var Version = "dev"
Functions ¶
func BuildQueryString ¶
BuildQueryString constructs a query string from key-value pairs, omitting empty values.
func FormatTimeAgo ¶
func PaginationQuery ¶
func ShowDetail ¶
ShowDetail renders a JSON object as a grouped text display.
Types ¶
type CLIConfig ¶
type CLIConfig struct {
DefaultProfile string `koanf:"default_profile"`
Profiles map[string]ProfileConfig `koanf:"profiles"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClientWithBaseURL ¶
NewClientWithBaseURL creates a client with explicit base URL (useful for testing).
func (*Client) DeleteWithBody ¶
func (c *Client) DeleteWithBody(ctx context.Context, path string, jsonBody []byte) (gjson.Result, error)
DeleteWithBody sends a DELETE with a JSON body.
func (*Client) DoRaw ¶
DoRaw is like Do but returns the raw response body bytes (for binary responses like PDFs).
type ProfileConfig ¶
type ProfileConfig struct {
APIKey string `koanf:"api_key"`
}
type TableWriter ¶
type TableWriter struct {
// TruncOrder specifies column indices in truncation priority order.
// The first index is truncated first when the table is too wide.
// Columns not listed are never truncated.
TruncOrder []int
// contains filtered or unexported fields
}
func NewTableWriter ¶
func NewTableWriter(w io.Writer, headers ...string) *TableWriter
func (*TableWriter) AddRow ¶
func (t *TableWriter) AddRow(cells ...string)
func (*TableWriter) Render ¶
func (t *TableWriter) Render()
Source Files
¶
- abuse_reports.go
- acronis_backup.go
- aggregation_packs.go
- api_keys.go
- cdn.go
- client.go
- cmd.go
- colocations.go
- config.go
- config_cmd.go
- datacenter_access.go
- dedicated_network_equipment.go
- dedicated_racks.go
- dedicated_servers.go
- detail.go
- domains.go
- emails.go
- floating_ips.go
- format.go
- instances.go
- invoices.go
- ips.go
- load_balancers.go
- orders.go
- pagination.go
- private_clouds.go
- private_networks.go
- remote_management.go
- services.go
- storage.go
- table.go
- traffic_policy.go
- version.go
- virtual_servers.go
- vps.go
- webhosting.go
Click to show internal directories.
Click to hide internal directories.