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

config

package
v1.38.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBaseURL = "http://127.0.0.1:8890"
)

Variables

This section is empty.

Functions

func ClearAPIKey

func ClearAPIKey(cfg *Config) error

ClearAPIKey 清除 Keychain 与文件中的密钥。

func Path

func Path() (string, error)

Path 返回配置文件路径。

func Save

func Save(cfg *Config) error

Save 写入配置文件(0600)。

func SaveAPIKey

func SaveAPIKey(cfg *Config) error

SaveAPIKey 优先写入 OS Keychain,失败则并入配置文件(0600)。

Types

type Config

type Config struct {
	BaseURL string `yaml:"base_url"`
	APIKey  string `yaml:"api_key"`
	Format  string `yaml:"format"`
}

Config 是 gitferry CLI 的本地配置(~/.config/gitferry/config.yaml)。

func Effective

func Effective() (*Config, error)

Effective 合并配置文件与环境变量(环境变量优先;api_key 再尝试 OS Keychain)。

func Load

func Load() (*Config, error)

Load 读取配置文件(不存在返回空配置)。

Jump to

Keyboard shortcuts

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