config

package
v1.7.20 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config reads and writes ~/.ccl/config.yaml.

Load is read-only: it normalizes in memory so every caller sees the same derived values, but never writes. Every change goes through Update, which holds an exclusive file lock across re-read → change → atomic write, so a long-running command (ccl set, an OAuth login) cannot overwrite what another ccl process changed in the meantime.

Index

Constants

View Source
const CurrentVersion = 2

CurrentVersion is the config schema this ccl writes.

Variables

This section is empty.

Functions

func ConfigPath

func ConfigPath() string

func Load

func Load() (*provider.Config, error)

Load reads the config and normalizes it in memory. It never writes; a missing file yields a fresh-install config.

func Save

func Save(cfg *provider.Config) error

Save replaces the whole config. Prefer Update, which cannot lose a change another process made since cfg was loaded.

func Update added in v1.5.18

func Update(fn func(*provider.Config) error) error

Update applies fn to the current config under the config lock and writes the result. fn sees the latest file, not a snapshot taken earlier, so concurrent ccl processes cannot drop each other's changes. Returning an error from fn leaves the file untouched.

Types

This section is empty.

Jump to

Keyboard shortcuts

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