config

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: MIT Imports: 13 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 CurrentVersion = 1

Variables

This section is empty.

Functions

func NormalizeProfileURL

func NormalizeProfileURL(value string) (string, error)

Types

type Alias

type Alias struct {
	Asset        string `toml:"asset"`
	Account      string `toml:"account,omitempty"`
	Organization string `toml:"organization,omitempty"`
}

type Behavior

type Behavior struct {
	RefreshCheckInterval Duration `toml:"refresh_check_interval"`
	RefreshBeforeExpiry  Duration `toml:"refresh_before_expiry"`
	ConnectTimeout       Duration `toml:"connect_timeout"`
	OAuthTimeout         Duration `toml:"oauth_timeout"`
}

type Config

type Config struct {
	Version        int                `toml:"version"`
	CurrentProfile string             `toml:"current_profile"`
	Behavior       Behavior           `toml:"behavior"`
	Profiles       map[string]Profile `toml:"profiles"`
}

func Decode

func Decode(data []byte) (Config, error)

func Default

func Default() Config

func (*Config) Validate

func (c *Config) Validate() error

type Duration

type Duration struct {
	time.Duration
}

func (Duration) MarshalText

func (d Duration) MarshalText() ([]byte, error)

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(text []byte) error

type Profile

type Profile struct {
	URL          string           `toml:"url"`
	Organization string           `toml:"organization,omitempty"`
	Aliases      map[string]Alias `toml:"aliases,omitempty"`
}

type Store

type Store struct {
	Path string
}

func (Store) Load

func (s Store) Load() (Config, error)

func (Store) Save

func (s Store) Save(value Config) (err error)

func (Store) Update

func (s Store) Update(ctx context.Context, change func(*Config) error) (err error)

Jump to

Keyboard shortcuts

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