config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const CONFIG_FILE_DEFAULT = "~/.config/scriv/config.json"
View Source
const CONFIG_FILE_ENV_OVERRIDE = "SCRIV_CONFIG"

Variables

This section is empty.

Functions

func ConfigFilePath

func ConfigFilePath() string

Determine the path to the configuration file, as it may be overridden by an environment variable

func WithConfig

func WithConfig(ctx context.Context, config Config) context.Context

Add the configuration to the context

Types

type Config

type Config struct {
	Paths    []PathEntry
	Settings Settings
	Logger   *slog.Logger
}

The main configuration object

func GetConfig

func GetConfig(ctx context.Context) Config

Get the configuration from the context

func InitConfig

func InitConfig() Config

Initialize the entire configuration

type ConfigKey

type ConfigKey struct{}

The key struct for accesing the config object in the context

type PathEntry

type PathEntry struct {
	Path  string
	Depth int
}

Defines a single Path under which to search for repositories

type Settings

type Settings struct {
	Ignore []string
}

General configuration settings

Jump to

Keyboard shortcuts

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