Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath() (string, error)

Types

type Config

type Config struct {
	Current  string             `toml:"current"`
	Profiles map[string]Profile `toml:"profiles"`
}

type CredentialReader

type CredentialReader interface {
	Get(profile string) (string, error)
}

type Profile

type Profile struct {
	URL string `toml:"url"`
}

type Runtime

type Runtime struct {
	Profile string
	URL     string
	Token   string
}

func Resolve

func Resolve(cfg Config, creds CredentialReader, in RuntimeInput) (Runtime, error)

type RuntimeInput

type RuntimeInput struct {
	Profile string
	URL     string
	Token   string
}

type Store

type Store struct{ Path string }

func NewStore

func NewStore(path string) (*Store, error)

func (*Store) Get

func (s *Store) Get(key string) (string, error)

func (*Store) Load

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

func (*Store) Save

func (s *Store) Save(cfg Config) error

func (*Store) Set

func (s *Store) Set(key, value string) error

Jump to

Keyboard shortcuts

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