configuration

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var (
	DevFolder       string
	DevFolderConfig string
	Config          = make(Paths)
)
View Source
var DefaultConfig = &ConfigFileType{
	DevFolder:         DefaultDevFolder(),
	Paths:             make(Paths),
	ConfigurationFile: DefaultFolderConfig(),
	MaxSubLevels:      MaximumSubLevel,
}

Functions

func DefaultDevFolder

func DefaultDevFolder() string

func DefaultFolderConfig

func DefaultFolderConfig() string

func DirectoryHasHiddenFolder

func DirectoryHasHiddenFolder(directory string) bool

func FolderChoice

func FolderChoice(pastas []string) string

func GetFolders

func GetFolders() string

func NeedUpdateConfigFile

func NeedUpdateConfigFile(filename string, force bool) bool

func ReadFolders

func ReadFolders()

func Setup

func Setup()

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

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) Load

func (pc *Paths) Load(filename string) error

func (*Paths) ReadFolders

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

func (*Paths) Save

func (pc *Paths) Save(filename string) 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