cfg

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvKeyCoauthorsPath = "GITMOB_COAUTHORS_PATH"
)

Variables

View Source
var (
	GlobalConfigFilePath string
)

Functions

func Add

func Add(key string, value string) error

Add adds a new line to the option without altering any existing values.

func AddCoAuthors

func AddCoAuthors(aa ...authors.Author) error

func AddGlobal

func AddGlobal(key string, value string) error

AddGlobal adds a new line to the global option without altering any existing values.

func Get

func Get(key string) string

Get gets the (last) value for the given option key.

func GetAll

func GetAll(key string) ([]string, error)

GetAll gets all values for a multi-valued option key.

func GetCoAuthors

func GetCoAuthors() ([]authors.Author, error)

GetCoAuthors gets the current list of co-authors from git config

func GetUser

func GetUser() (*authors.Author, error)

GetUser builds an authors.Author from the current configured user

func Has

func Has(key string) bool

Has checks if the given option exists in the configuration.

func HasGlobal

func HasGlobal(key string) bool

HasGlobal checks if the given option exists in the global configuration.

func ReadAllCoAuthorsFromFile

func ReadAllCoAuthorsFromFile() (map[string]authors.Author, error)

func Remove

func Remove(key string) error

Remove removes the given key from the configuration.

func RemoveAll

func RemoveAll(key string) error

RemoveAll removes all the given keys from the configuration.

func RemoveAllGlobal

func RemoveAllGlobal(key string) error

RemoveAllGlobal removes all the given keys from the configuration.

func RemoveGlobal

func RemoveGlobal(key string) error

RemoveGlobal removes the given key from the configuration.

func RemoveSection

func RemoveSection(key string) error

RemoveSection removes the given section from the configuration.

func RemoveSectionGlobal

func RemoveSectionGlobal(key string) error

RemoveSectionGlobal removes the given section from the global configuration.

func Set

func Set(key string, value string) error

Set sets the option, overwriting the existing value if one exists.

func SetCoAuthors

func SetCoAuthors() error

func SetGlobal

func SetGlobal(key string, value string) error

SetGlobal sets the global option, overwriting the existing value if one exists.

func ShortLogAuthorSummary

func ShortLogAuthorSummary() (map[string]authors.Author, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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