config

package
v1.0.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ColorAuto = "auto"

ColorAuto represents the auto-state for colors

View Source
const ColorOff = "off"

ColorOff represents the off-state for colors

View Source
const ColorOn = "on"

ColorOn represnets the on-state for colors

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Profile    Profile
	Color      string
	LogLevel   string
	DeviceName string

	// Helpers
	APIBaseURL       string
	DashboardBaseURL string
	ConsoleBaseURL   string
	WSBaseURL        string
	Insecure         bool

	// Config
	ConfigFileFlag string // flag -- should NOT use this directly
	// contains filtered or unexported fields
}

Config handles all overall configuration for the CLI

func (*Config) GetClient

func (c *Config) GetClient() *hookdeckclient.Client

func (*Config) InitConfig

func (c *Config) InitConfig()

InitConfig reads in profiles file and ENV variables if set.

func (*Config) ListProfiles

func (c *Config) ListProfiles() []string

func (*Config) RemoveAllProfiles

func (c *Config) RemoveAllProfiles() error

RemoveAllProfiles removes all the profiles from the config file. TODO: consider adding log to clarify which config file is being used

func (*Config) UseProject

func (c *Config) UseProject(projectId string, projectMode string) error

UseProject selects the active project to be used

type ConfigFS added in v1.0.3

type ConfigFS interface {
	// contains filtered or unexported methods
}

type Profile

type Profile struct {
	Name        string // profile name
	APIKey      string
	ProjectId   string
	ProjectMode string

	Config *Config
}

func (*Profile) RemoveProfile

func (p *Profile) RemoveProfile() error

func (*Profile) SaveProfile

func (p *Profile) SaveProfile() error

func (*Profile) UseProfile

func (p *Profile) UseProfile() error

func (*Profile) ValidateAPIKey

func (p *Profile) ValidateAPIKey() error

Jump to

Keyboard shortcuts

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