configuration

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const MaximumAge = 86400
View Source
const MaximumSubLevel = 4

Variables

View Source
var (
	HomePath                string
	MaxFolderLevel          int
	DevFolder               string
	ConfigFileName          string
	DefaultDevFolder        string
	DefaultFolderConfigFile string
	DefaultOutputFile       string
)
View Source
var DefaultConfig = &ConfigFileType{
	DevFolder:         DefaultDevFolder,
	Paths:             make(Paths),
	ConfigurationFile: DefaultFolderConfigFile,
	MaxSubLevels:      MaximumSubLevel,
}

Functions

func CurrentDir added in v0.2.0

func CurrentDir() string

func DirectoryHasHiddenFolder

func DirectoryHasHiddenFolder(directory string) bool

func NeedUpdateConfigFile

func NeedUpdateConfigFile(filename string, force bool) bool

func SetupBaseEnvironment added in v0.0.2

func SetupBaseEnvironment() error

func SetupEnvironmentVars added in v0.0.2

func SetupEnvironmentVars(devFolder string, configurationFile string)

Types

type ConfigFileType

type ConfigFileType struct {
	DevFolder         string `json:"dev_folder,omitempty"`
	Paths             Paths  `json:"paths,omitempty"`
	ConfigurationFile string `json:"configuration_file,omitempty"`
	MaxSubLevels      int    `json:"max_sub_levels,omitempty"`
}

func (*ConfigFileType) Load

func (cf *ConfigFileType) Load(fileName string) error

func (*ConfigFileType) Save

func (cf *ConfigFileType) Save() error

func (*ConfigFileType) TryLoad added in v0.0.2

func (cf *ConfigFileType) TryLoad(fileName string) bool

type MetadataType

type MetadataType struct {
	AppName     string
	Version     string
	BuildDate   string
	CompileTime time.Time
}
var MetaData MetadataType

func LoadMetaData

func LoadMetaData() MetadataType

type PathSetup

type PathSetup struct {
	Ignore  bool   `json:"ignore"`
	Command string `json:"cmd"`
	Path    string `json:"path"`
}

func (PathSetup) ToString

func (path PathSetup) ToString() string

type Paths

type Paths map[string]PathSetup

func (*Paths) FindFolder

func (pc *Paths) FindFolder(words []string) []PathSetup

func (*Paths) FolderList

func (pc *Paths) FolderList() []string

func (*Paths) Get

func (pc *Paths) Get(path string) (PathSetup, error)

func (*Paths) ReadFolders

func (pc *Paths) ReadFolders(devFolder string, maxSubLevel int) error

func (*Paths) Set

func (pc *Paths) Set(path PathSetup) error

Jump to

Keyboard shortcuts

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