config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package config loads git-customs TOML configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath() (string, error)

DefaultPath returns ~/.config/git-customs/config.toml.

Types

type Config

type Config struct {
	Command      string           `toml:"command"`
	Commands     []string         `toml:"commands"`
	Timeout      string           `toml:"timeout"`
	ClearPattern string           `toml:"clear_pattern"`
	Repos        map[string]bool  `toml:"repos"`
	Visibility   VisibilityConfig `toml:"visibility"`
}

Config is the git-customs configuration.

func Load

func Load(path string) (*Config, error)

Load reads config from path. A missing file yields defaults and a nil error.

func (*Config) CommandList

func (c *Config) CommandList() []string

CommandList returns the commands to run, in order. `commands` takes precedence over the single `command`; each command receives the full diff on stdin and must pass for the push to be allowed.

func (*Config) TimeoutDuration

func (c *Config) TimeoutDuration() time.Duration

TimeoutDuration parses Timeout, defaulting to 60s on error.

type VisibilityConfig

type VisibilityConfig struct {
	SkipHosts  []string `toml:"skip_hosts"`
	SkipOwners []string `toml:"skip_owners"`
}

VisibilityConfig lists hosts/owners always treated as private.

Jump to

Keyboard shortcuts

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