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

config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAPIURL = "https://api.gora8.com"
)

Variables

This section is empty.

Functions

func Clear

func Clear() error

Clear removes all authentication fields from the config and saves.

func Save

func Save(cfg *Config) error

Save writes the config to disk, creating the directory if needed.

Types

type Config

type Config struct {
	APIKey    string `json:"api_key"`
	APIURL    string `json:"api_url"`
	UserEmail string `json:"user_email"`
	UserID    string `json:"user_id"`
}

Config holds the persisted CLI configuration.

func Load

func Load() (*Config, error)

Load reads the config from disk. Returns an empty config if the file does not exist yet (not an error).

func (*Config) IsAuthenticated

func (c *Config) IsAuthenticated() bool

IsAuthenticated returns true when an API key is present.

Jump to

Keyboard shortcuts

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