Documentation ¶
Overview ¶
Package dotfile holds functionality for working with dotfiles and registries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("dotfile not found")
ErrNotFound is returned when a dotfile is not found.
Functions ¶
This section is empty.
Types ¶
type Dotfile ¶
type Dotfile struct { // Name is the name of the dotfile used to uniquely identify it in the registry. Name string `yaml:"-"` // SrcPath is the path to the dotfile source within the registry. // It must be relative and cannot start with '.' or '..'. SrcPath string `yaml:"src"` // DstPath is the path dotfile on the OS filesystem. // It must be absolute i.e. start with a slash. // The one exception to this rule is it maybe start with '~/'. // It is up to the caller to decide how to handle '~'. DstPath string `yaml:"dst"` // OS is a list of supported operating systems for this dotfile. // If OS is empty, it is interpreted as all operating systems being supported. OS []string `yaml:"os"` }
Dotfile represents a dotfile managed by a registry.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry represents a dot registry. A registry is a directory containing dotfile sources and configuration. Registries are read-only.
func NewRegistry ¶
NewRegistry creates a new Registry object from fsys. fsys must contain a `dot.yml` file that holds the configuration for the registry. NewRegistry will read `dot.yml` and return an validation errors encountered.
type ValidationError ¶
ValidationError represents a dotfile having failed validation. It contains the dotfile name and a list of validation failure messages.
func (*ValidationError) Error ¶
func (ve *ValidationError) Error() string