common

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CompletionUse     string   = "completion [bash|zsh|fish|powershell]"
	CompletionShort   string   = "Generate completion script"
	InstallUse        string   = "install [uri]"
	InstallShort      string   = "Installs dotfiles"
	InstallLong       string   = ""
	DiffUse           string   = "diff [collection]"
	DiffShort         string   = "Show changes between linked files and repository"
	DiffLong          string   = `Show changes between linked files and repository`
	InstallLocalPath  string   = path.Join(homeDir, ".local/share/dotfiles")
	InstallGlobalPath string   = "/usr/share/dotfiles"
	DotfileConfig     []string = []string{"dotfiles.yaml", "dotfiles.yml", "dotfile.yaml", "dotfile.yml"}
	StateConfigName   string   = "dotfiles.yaml"
	LogDir            string   = "/var/log/dotfiles"
)

Functions

func IsEmpty

func IsEmpty(name string) (bool, error)
func Unlink(stateConfig *StateConfig) (err error)

func WriteStatefile

func WriteStatefile(stateConfig StateConfig) (err error)

Types

type Arg

type Arg struct {
	Name        string
	Description string
}

type Collection

type Collection struct {
	Simple SimpleCollection
	Expert ExpertCollection
}

func (*Collection) UnmarshalYAML added in v0.0.5

func (c *Collection) UnmarshalYAML(unmarshal func(interface{}) error) (err error)

type Collections added in v0.0.5

type Collections map[string]Collection

type Config

type Config struct {
	Collections Collections
}

func (*Config) UnmarshalYAML added in v0.0.5

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) (err error)

type ConfigManager

type ConfigManager struct {
	ConfigPath string
	Config     Config

	StateConfig StateConfig
}

type Diff

type Diff struct {
	Root     string
	ToAdd    []string
	ToDelete []string
	ToIgnore []string
}

type Differ

type Differ struct {
	StateConfig StateConfig
	// contains filtered or unexported fields
}

func (*Differ) Diff

func (differ *Differ) Diff(collection ...string) (diffs []Diff, err error)

type ExpertCollection added in v0.0.5

type ExpertCollection struct {
	Mutex    [][]string `yaml:"mutex"`
	Default  []string   `yaml:"default"`
	Ignore   []string   `yaml:"ignore"`
	Optional []string   `yaml:"optional"`
}

type IHandler

type IHandler interface {
}

type SimpleCollection added in v0.0.5

type SimpleCollection []string

type StateConfig

type StateConfig struct {
	Context        string              `yaml:"context"`
	ContextName    string              `yaml:"contextName"`
	ContextAbsPath string              `yaml:"contextAbsPath"`
	Target         string              `yaml:"target"`
	Linked         map[string][]string `yaml:"linked"`
}

func ReadStatefile

func ReadStatefile() (stateConfig StateConfig, err error)

func (*StateConfig) MarshalYAML

func (l *StateConfig) MarshalYAML() (int interface{}, err error)

func (*StateConfig) UnmarshalYAML

func (l *StateConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

type UsageHelper

type UsageHelper struct {
	Cmd *cobra.Command
	// contains filtered or unexported fields
}

func (*UsageHelper) AddArg

func (helper *UsageHelper) AddArg(name string, description string)

func (*UsageHelper) AddOptArg

func (helper *UsageHelper) AddOptArg(name string, description string)

func (*UsageHelper) Parse

func (helper *UsageHelper) Parse() error

Jump to

Keyboard shortcuts

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