entity

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NormalBehaviour = ""
	CopyBehaviour   = "copy"
	OutputBehaviour = "output"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Basic

type Basic struct {
	Name        string                `json:"name"`
	SrcDerived  string                `json:"-"`
	DstDerived  string                `json:"-"`
	Vars        map[string]string     `json:"vars"`
	Directories map[string]*Directory `json:"dirs"`
	Files       map[string]*File      `json:"files"`
	Execs       map[string]*CLE       `json:"execs"`
	Import      bool                  `json:"import"`
	Opts        string                `json:"options"`
	Flts        filters               `json:"filters"`
	Mpns        []*Mapping            `json:"mappings"`
	This        ConfigReader          `json:"-"`
	Parent      ConfigReader          `json:"-"`

	*state.Detect
	// contains filtered or unexported fields
}

func (*Basic) AddPosibleMapping added in v0.0.15

func (e *Basic) AddPosibleMapping(m Mapping)

func (Basic) ContainsFilter added in v0.0.15

func (b Basic) ContainsFilter(filter string) bool

func (Basic) ControlMappings added in v0.0.15

func (e Basic) ControlMappings() []*Mapping

func (Basic) Derived added in v0.0.15

func (b Basic) Derived() (string, string)

func (Basic) Filters added in v0.0.15

func (e Basic) Filters() filters

func (Basic) Identifier added in v0.0.2

func (b Basic) Identifier() string

func (*Basic) Load added in v0.0.15

func (e *Basic) Load(f io.Reader) error

func (Basic) Options added in v0.0.15

func (e Basic) Options() string

func (Basic) Output added in v0.0.15

func (b Basic) Output() string

func (Basic) Perform added in v0.0.2

func (*Basic) Process added in v0.0.15

func (e *Basic) Process(bb BranchBuilder, rm refmap.Mutator, ctx context.Context) error

func (*Basic) ProcessState added in v0.0.15

func (e *Basic) ProcessState(s ...string) error

func (Basic) Variables added in v0.0.15

func (e Basic) Variables() map[string]string

type Branch

type Branch struct {
	Directories []string
	Filename    string
	Vars        map[string]string
	TemplateMethods
}

func (*Branch) Build added in v0.0.15

func (b *Branch) Build(e interface{}) (interface{}, error)

func (*Branch) Clone added in v0.0.15

func (b *Branch) Clone() BranchBuilder

type BranchBuilder added in v0.0.15

type BranchBuilder interface {
	Build(interface{}) (interface{}, error)
	Clone() BranchBuilder
}

type CLE added in v0.0.15

type CLE struct {
	Name    string
	Cmd     []string          `json:"cmd"`
	Timeout uint              `json:"timeout"`
	Env     map[string]string `json:"env"`
	Dir     string            `json:"dir"`
	STDOut  *bytes.Buffer
	STDErr  *bytes.Buffer
	Parent  ConfigReader `json:"-"`
	*state.Detect
}

func (CLE) Derived added in v0.0.15

func (e CLE) Derived() (string, string)

func (CLE) Identifier added in v0.0.15

func (e CLE) Identifier() string

func (CLE) Output added in v0.0.15

func (e CLE) Output() string

func (*CLE) Perform added in v0.0.15

func (e *CLE) Perform(rm refmap.Grapher, ctx context.Context) error

func (*CLE) Process added in v0.0.15

func (e *CLE) Process(rm refmap.Mutator, ctx context.Context) error

func (*CLE) ProcessState added in v0.0.15

func (e *CLE) ProcessState() error

type ConfigReader added in v0.0.15

type ConfigReader interface {
	Identifier() string
	Derived() (string, string)
	ControlMappings() []*Mapping
	AddPosibleMapping(Mapping)
	Options() string
	ContainsFilter(string) bool
	Filters() filters
	Variables() map[string]string
	refmap.Actioner
}

type Directory

type Directory struct {
	OrigOverride string `json:"orig"`
	DestOverride string `json:"dest"`
	// Import      *configImport `json:"import"`
	Basic
}

func (Directory) BehaviourOptionsContain added in v0.0.15

func (d Directory) BehaviourOptionsContain(o string) bool

func (Directory) ContainsFilter added in v0.0.15

func (d Directory) ContainsFilter(filter string) bool

func (Directory) Derived added in v0.0.15

func (d Directory) Derived() (string, string)

func (Directory) Identifier added in v0.0.15

func (d Directory) Identifier() string

func (Directory) Output added in v0.0.15

func (d Directory) Output() string

func (*Directory) Process

func (e *Directory) Process(bb BranchBuilder, rm refmap.Mutator, ctx context.Context) error

func (*Directory) ProcessState added in v0.0.17

func (e *Directory) ProcessState() error

type File added in v0.0.15

type File struct {
	Name     string             `json:"name"`
	Source   string             `json:"source"`
	Vars     map[string]string  `json:"vars"`
	Opts     string             `json:"options"`
	Flts     filters            `json:"filters"`
	Mpns     []*Mapping         `json:"mappings"`
	Template *template.Template `json:"-"`
	Parent   ConfigReader       `json:"-"`
	Branch   BranchBuilder      `json:"-"`
	*state.Detect
}

func (File) ContainsFilter added in v0.0.15

func (e File) ContainsFilter(filter string) bool

func (File) Identifier added in v0.0.15

func (file File) Identifier() string

func (File) Output added in v0.0.15

func (f File) Output() string

func (*File) Perform added in v0.0.15

func (file *File) Perform(rm refmap.Grapher, ctx context.Context) error

func (*File) Process added in v0.0.15

func (e *File) Process(bb BranchBuilder, rm refmap.Mutator, ctx context.Context) error

func (File) ProcessState added in v0.0.15

func (e File) ProcessState() error

type Mapping added in v0.0.15

type Mapping struct {
	Start      Regexp `json:"start"`
	End        Regexp `json:"end"`
	StartSet   string
	EndSet     string
	Recurrence int `json:"recurrence"`
}

type Project added in v0.0.13

type Project struct {
	Testing      bool       `json:"testing"`
	Environment  string     `json:"environment"`
	Repository   Repository `json:"repo"`
	OrigLocation string     `json:"orig"`
	DestLocation string     `json:"dest"`

	Basic
	// contains filtered or unexported fields
}

func NewProject added in v0.0.15

func NewProject() *Project

func (Project) Identifier added in v0.0.15

func (p Project) Identifier() string

func (*Project) Load added in v0.0.13

func (e *Project) Load(f io.Reader) error

func (*Project) LoadFile added in v0.0.15

func (e *Project) LoadFile(fn string) error

func (*Project) Process added in v0.0.13

func (e *Project) Process(bb BranchBuilder, rm refmap.Mutator, ctx context.Context) error

type ProjectBranch added in v0.0.13

type ProjectBranch struct {
	Project     string
	Testing     bool
	Environment string
	Branch
}

func (*ProjectBranch) Build added in v0.0.15

func (pb *ProjectBranch) Build(e interface{}) (interface{}, error)

func (*ProjectBranch) Clone added in v0.0.15

func (b *ProjectBranch) Clone() BranchBuilder

type Regexp added in v0.0.15

type Regexp struct {
	regexp.Regexp
}

func Compile added in v0.0.15

func Compile(expr string) (*Regexp, error)

func (*Regexp) UnmarshalText added in v0.0.15

func (r *Regexp) UnmarshalText(text []byte) error

type Repository added in v0.0.13

type Repository struct {
}

type TemplateMethods

type TemplateMethods struct {
}

func (TemplateMethods) Clean

func (TemplateMethods) Clean(s string) string

func (TemplateMethods) CleanUpper

func (TemplateMethods) CleanUpper(s string) string

func (TemplateMethods) Env added in v0.0.15

func (TemplateMethods) Env(s string) string

func (TemplateMethods) Plural

func (TemplateMethods) Plural(s string) string

func (TemplateMethods) Title

func (TemplateMethods) Title(s string) string

func (TemplateMethods) Upper

func (TemplateMethods) Upper(s string) string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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