config

package
v6.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package config reads and writes the CLI configuration exactly as the TypeScript CLI did, so that an upgrade keeps every profile a user has already set up.

Index

Constants

View Source
const DefaultBaseURL = "https://platform.steadybit.com"

Variables

View Source
var ProfileOverride string

ProfileOverride is the --profile flag: the profile to use instead of the active one, for this command only.

Functions

func AddProfile

func AddProfile(profile Profile) error

func RemoveProfile

func RemoveProfile(name string) error

func SetActiveProfile

func SetActiveProfile(name string) error

Types

type Configuration

type Configuration struct {
	APIAccessToken string
	BaseURL        string
}

func Load

func Load() (Configuration, error)

Load resolves the configuration: environment variables win over the active profile. An empty STEADYBIT_TOKEN counts as set, as it did in the TypeScript CLI, so that a pipeline can deliberately blank it out.

type Profile

type Profile struct {
	Name           string `json:"name"`
	APIAccessToken string `json:"apiAccessToken"`
	BaseURL        string `json:"baseUrl,omitempty"`
}

func ActiveProfile

func ActiveProfile() (*Profile, error)

ActiveProfile is the profile --profile names, else the selected one, else the first.

func Profiles

func Profiles() ([]Profile, error)

Jump to

Keyboard shortcuts

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