config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package config handles configuration management

Index

Constants

View Source
const (
	// DefaultAPIURL is the default GitScrum API URL
	DefaultAPIURL = "https://services.gitscrum.com"

	// ConfigDir is the config directory name
	ConfigDir = ".gitscrum"

	// ConfigFile is the config file name
	ConfigFile = "config.yaml"
)

Variables

This section is empty.

Functions

func ConfigPath

func ConfigPath() (string, error)

ConfigPath returns the path to config file

func GetLanguage

func GetLanguage() string

GetLanguage returns the configured language or "en" as default

func Save

func Save(cfg *Config) error

Save writes the configuration to file

func SetLanguage

func SetLanguage(lang string) error

SetLanguage sets the default language (en, pt, fr, es)

func SetProject

func SetProject(slug string) error

SetProject sets the default project

func SetWorkspace

func SetWorkspace(slug string) error

SetWorkspace sets the default workspace

func TokenPath

func TokenPath() (string, error)

TokenPath returns the path to token file

Types

type Config

type Config struct {
	// API URL
	APIURL string `mapstructure:"api_url"`

	// Default workspace slug
	Workspace string `mapstructure:"workspace"`

	// Default project slug
	Project string `mapstructure:"project"`

	// Language preference (en, pt, fr, es)
	Language string `mapstructure:"language"`

	// OAuth settings
	OAuth OAuthConfig `mapstructure:"oauth"`
}

Config holds the CLI configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a new Config with default values

func Load

func Load() (*Config, error)

Load reads the configuration from file and environment

func (*Config) Save

func (c *Config) Save() error

Save method saves config (receiver method for compatibility)

type OAuthConfig

type OAuthConfig struct {
	ClientID string `mapstructure:"client_id"`
	Scopes   string `mapstructure:"scopes"`
}

OAuthConfig holds OAuth configuration

Directories

Path Synopsis
Package projectconfig handles project-level configuration (.gitscrum.yml)
Package projectconfig handles project-level configuration (.gitscrum.yml)

Jump to

Keyboard shortcuts

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