config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileMatches

func FileMatches(src string, file File) (bool, string)

FileMatches determines a particular file matches returned string can either be "folder" or "file". if bool is false, it can also be empty ("")

func GetLocalTomlPath

func GetLocalTomlPath(dotDir string) string

GetLocalTomlPath gets location of local (.) config (local.dots.toml)

func GetProjectDir

func GetProjectDir() string

GetProjectDir gets the root location of the current project, by recursively walking up directory tree until a globe.toml file is found. It stop searching after it reaches the user's home directory

func GetSystemTomlPath

func GetSystemTomlPath(dotDir string) string

GetSystemTomlPath gets location of system (/) config (system.dots.toml)

func GetUserTomlPath

func GetUserTomlPath(dotDir string) string

GetUserTomlPath gets location of user (~) config (user.dots.toml)

func IgnoreMatches

func IgnoreMatches(src string, file Ignore) (bool, string)

IgnoreMatches determines a particular ignore entry matches returned string can either be "folder" or "file". if bool is false, it can also be empty ("")

Types

type Config

type Config struct {
	Project struct {
		License string   `toml:"license"`
		Tags    []string `toml:"tags"`
	} `toml:"project"`
}

Config is the configuration file used to manage Globe. This is your `globe.toml` file

type File

type File struct {
	File       string   `toml:"file"`
	Tags       []string `toml:"tags"`
	Heuristic1 bool
	Heuristic2 bool
	Heuristic3 bool
}

File represents a file entry in a `*.dots.toml` file

type Ignore

type Ignore struct {
	File string `toml:"file"`
}

Ignore represents an ignore entry in a `*.dots.toml` file

type LocalDotsConfig

type LocalDotsConfig struct {
	Files []File `toml:"files"`
}

LocalDotsConfig represents the `local.dots.toml` file

func GetLocalToml

func GetLocalToml(dotDir string) LocalDotsConfig

GetLocalToml gets local (.) config

type SystemDotsConfig

type SystemDotsConfig struct {
	Files   []File   `toml:"files"`
	Ignores []Ignore `toml:"ignores"`
}

SystemDotsConfig represents the `system.dots.toml` file

func GetSystemToml

func GetSystemToml(dotDir string) SystemDotsConfig

GetSystemToml gets system (/) config

type UserDotsConfig

type UserDotsConfig struct {
	Files   []File   `toml:"files"`
	Ignores []Ignore `toml:"ignores"`
}

UserDotsConfig represents the `user.dots.toml` file

func GetUserToml

func GetUserToml(dotDir string) UserDotsConfig

GetUserToml gets user (~) config

Jump to

Keyboard shortcuts

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