config

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Path

func Path() (string, error)

Path returns the config file path. On Windows: %AppData%\pb\config.toml On macOS/Linux: ~/.config/pb/config.toml (XDG style)

func WriteConfigToFile

func WriteConfigToFile(config *Config) error

WriteConfigToFile writes the configuration to the config file

Types

type Config

type Config struct {
	Profiles       map[string]Profile
	DefaultProfile string
}

Config is the struct that holds the configuration

func ReadConfigFromFile

func ReadConfigFromFile() (config *Config, err error)

ReadConfigFromFile reads the configuration from the config file

type Profile

type Profile struct {
	URL      string `toml:"url" json:"url"`
	Username string `toml:"username,omitempty" json:"username,omitempty"`
	Password string `toml:"password,omitempty" json:"password,omitempty"`
	Token    string `toml:"token,omitempty" json:"token,omitempty"`
}

Profile is the struct that holds the profile configuration

func GetProfile

func GetProfile() (Profile, error)

func (*Profile) GrpcAddr

func (p *Profile) GrpcAddr(port string) string

Jump to

Keyboard shortcuts

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