profile

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 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 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