config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 6 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 is where KairoCode's settings are: kairocode.json, the user's ($XDG_CONFIG_HOME/kairocode, else ~/.config/kairocode) and a project's (at its root), and the user's other files beside it. It finds and reads them; what a section means is its reader's.

Index

Constants

View Source
const File = "kairocode.json"

File is the settings file's name, in a project and in the user's folder.

Variables

This section is empty.

Functions

func Home

func Home() string

Home is the user's folder of settings, of every program: $XDG_CONFIG_HOME, else ~/.config; "" if there is no home to find it in.

func ProjectFile

func ProjectFile(dir string) string

ProjectFile is the kairocode.json of the project in dir.

func UserDir

func UserDir() string

UserDir is KairoCode's folder in it: the user's kairocode.json, plugins, marketplaces, credentials.

func UserFile

func UserFile() string

UserFile is the user's kairocode.json; "" with no home to find it in (read, it is not there): a path relative to the daemon's folder could be a project's, which must not set what is the user's alone.

Types

type Layer

type Layer struct {
	Path    string
	Project bool // the project's, not the user's
	Data    []byte
}

Layer is one kairocode.json as read.

func Layers

func Layers(dir string) ([]Layer, error)

Layers are the user's kairocode.json, then the project's in dir (none for dir ""), each if it is there. One there but not readable is left out and told in the error, with the others still given: a reader that goes on without it may. With no home to find it in (Home ""), the user has none: a path relative to the daemon's folder could be a project's, which must not set what is the user's alone.

func User

func User() (Layer, bool, error)

User is the user's kairocode.json, if it is there: for the settings a project's cannot set.

func (Layer) Decode

func (l Layer) Decode(v any) error

Decode reads layer's section into v (a struct of the section's fields, tagged as kairocode.json names them), saying which file was wrong.

Jump to

Keyboard shortcuts

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