pkg

package
v0.0.0-...-b12587e Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version = "dev"
	Commit  = ""
	Date    = ""
	BuiltBy = ""
)
View Source
const (
	// defaultCfg = "~/.config/over.yml"
	EnvPrefix = "OVER_"
)

Variables

This section is empty.

Functions

func NewParser

func NewParser() *viper.Viper

NewParser instanciate a new Viper config parser configured for over

func SortedStringKeys

func SortedStringKeys(i interface{}) []string

Types

type Config

type Config struct {
	Home  string
	Debug bool
}

Config stores the un marshalled parameters

func NewConfig

func NewConfig(parser *viper.Viper) (*Config, error)

NewConfig extracts configuration parameters from execution parameters and configuration file

func (Config) String

func (cfg Config) String() string

type Overlay

type Overlay struct {
	Name   string
	Root   string
	Config *OverlayConfig
}

func NewOverlay

func NewOverlay(name string, root string) *Overlay

NewOverlay instianciate a new or existing overlay

func (*Overlay) Add

func (o *Overlay) Add(path string) error

Add a file to the overlay

func (*Overlay) Apply

func (o *Overlay) Apply(target string) error

func (*Overlay) Delete

func (o *Overlay) Delete(path string) error

Delete the overlay from the repository. If the overlay does not exists, Delete does not nothing. If the overlay exists, files are removed from git management and disk.

func (*Overlay) Init

func (o *Overlay) Init(path string) error

Init perform the overlay initialization. If the overlay does not exists, Init create the overlay on-disk layout and adds initial files to git management. If the overlay already exists, Init does nothing.

func (*Overlay) ParseConfig

func (o *Overlay) ParseConfig() error

func (*Overlay) PlanExecution

func (o *Overlay) PlanExecution(target string, opts *plan.ExecuteOptions) (*plan.Plan, error)

func (*Overlay) Pretty

func (o *Overlay) Pretty() string

func (*Overlay) Rm

func (o *Overlay) Rm(path string) error

Rm remove a file from the overlay

func (*Overlay) String

func (o *Overlay) String() string

type OverlayConfig

type OverlayConfig struct {
	Name    string
	Exclude []string
}

type Repository

type Repository struct {
	Cfg      *Config
	Root     string
	Overlays map[string]*Overlay
}

func NewRepository

func NewRepository(cfg *Config) *Repository

func (*Repository) Get

func (r *Repository) Get(name string) *Overlay

func (*Repository) Init

func (r *Repository) Init() error

Init create the repository on disk if not existant

func (*Repository) List

func (r *Repository) List() []*Overlay

List all overlays into the repository

func (*Repository) New

func (r *Repository) New() *Overlay

New create a new overlay into the repository

func (*Repository) Rm

func (r *Repository) Rm() error

Rm removes an overlay from the repository

func (*Repository) String

func (r *Repository) String() string

type Workdir

type Workdir struct {
	Root    string
	Overlay *Overlay
}

Workdir represent a git working directory used by git-over

Directories

Path Synopsis
Package actions provides all the `plan.Step` implementations and factories
Package actions provides all the `plan.Step` implementations and factories
Package plan provides a model to describe an execution plan.
Package plan provides a model to describe an execution plan.

Jump to

Keyboard shortcuts

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