profile

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 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() (*client.Client, error)

Jump to

Keyboard shortcuts

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