enumconf

package module
v0.0.0-...-31c7c41 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// contains filtered or unexported fields
}

Options contains the enumeration options for config files

func New

func New(appName string) *Options

Create a new config file enumerator for the provided app name. The app name must be a valid path segment.

func (*Options) ConfigName

func (o *Options) ConfigName(configName string) *Options

ConfigName overrides the default config file name of appName.conf

func (*Options) ConfigNameInPath

func (o *Options) ConfigNameInPath(configName string) *Options

ConfigNameInPath overrides the default in-path config file name of .appName

func (*Options) Enumerate

func (o *Options) Enumerate() []string

Enumerate generates a list of config files present in the system. It is ordered system config files, user config files, path config from root to the current working directory.

func (*Options) EnumeratePath

func (o *Options) EnumeratePath() []string

EnumeratePath generates a list of config files in the current working dir or it's parents. May be nil or empty.

func (*Options) EnumerateSystem

func (o *Options) EnumerateSystem() []string

EnumerateSystem generates a list of system config files. May be nil or empty.

func (*Options) EnumerateUser

func (o *Options) EnumerateUser() []string

EnumerateUser generates a list of user config files. May be nil or empty.

func (*Options) FS

func (o *Options) FS(fs fs.FS) *Options

FS overrides the default file system

func (*Options) IncludeMissing

func (o *Options) IncludeMissing(include bool) *Options

IncludeMissing defines if missing files should still be present in the config file list

Jump to

Keyboard shortcuts

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