profile

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultProfileName = "default"

Variables

This section is empty.

Functions

func Command

func Command() *cobra.Command

Command returns the profile cobra command.

func ConfigDir

func ConfigDir() (string, error)

ConfigDir returns the base directory for storing profiles.

func ConfigPath

func ConfigPath(profileName string) (string, error)

ConfigPath returns the full path to a profile's JSON file.

func EnsureConfigDir

func EnsureConfigDir() error

EnsureConfigDir creates the config directory if it does not exist.

Types

type Option added in v1.10.0

type Option func(*clientConfig)

Option configures the client a profile builds.

func WithMaxConcurrency added in v1.10.0

func WithMaxConcurrency(n int) Option

WithMaxConcurrency sizes the connection pool to the number of requests the caller intends to have in flight at once.

Without it the transport keeps Go's default of two idle connections per host, so a run that uploads dozens of files at a time closes all but two of its connections the moment they go idle and opens fresh ones — paying a DNS lookup, a TCP connect and a TLS handshake per file that the API never sees in its own timings.

type Profile

type Profile struct {
	Endpoint    string    `json:"endpoint"`
	CreatedAt   time.Time `json:"createdAt"`
	Version     *string   `json:"version"`
	Credentials string    `json:"credentials"`
}

Profile represents a CLI profile's settings.

func Load

func Load(profileName string) (*Profile, error)

Load reads and parses a profile by name.

func (*Profile) APIKey

func (c *Profile) APIKey() string

ApiKey returns the key portion of the credentials (before the colon).

func (*Profile) APISecret

func (c *Profile) APISecret() string

ApiSecret returns the secret portion of the credentials (after the colon).

func (*Profile) Client

func (c *Profile) Client(opts ...Option) (*client.Client, error)

Jump to

Keyboard shortcuts

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