core

package
v0.0.0-...-0169d83 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigTemplateCache = "template_cache_dir"
View Source
const ConfigTemplateExt = "template_ext"
View Source
const GitPrefix = "git+"

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context interface {
	Src() SourceDir
	Dest() DestDir
	Options() *GopierOptions
	TemplateContext() *TemplateContext
}

func CreateDefaultContext

func CreateDefaultContext(src string, dest string, valuesFile string, options *GopierOptions) (Context, error)

type DefaultContext

type DefaultContext struct {
	// contains filtered or unexported fields
}

func (*DefaultContext) Dest

func (d *DefaultContext) Dest() DestDir

func (*DefaultContext) Options

func (d *DefaultContext) Options() *GopierOptions

func (*DefaultContext) Src

func (d *DefaultContext) Src() SourceDir

func (*DefaultContext) TemplateContext

func (d *DefaultContext) TemplateContext() *TemplateContext

type DefaultRunner

type DefaultRunner struct{}

func CreateDefaultRunner

func CreateDefaultRunner() DefaultRunner

func (*DefaultRunner) Run

func (p *DefaultRunner) Run(context Context) error

type DestDir

type DestDir interface {
	Path() string
	AbsPath() string
	Validate() error
}

type GitSourceDir

type GitSourceDir struct {
	// contains filtered or unexported fields
}

func (GitSourceDir) AbsPath

func (g GitSourceDir) AbsPath() string

func (GitSourceDir) Bootstrap

func (g GitSourceDir) Bootstrap() error

func (GitSourceDir) Finalize

func (g GitSourceDir) Finalize(context Context, rollback bool, err error) error

func (GitSourceDir) HooksAbsPath

func (g GitSourceDir) HooksAbsPath() string

func (GitSourceDir) Path

func (g GitSourceDir) Path() string

func (GitSourceDir) TemplateAbsPath

func (g GitSourceDir) TemplateAbsPath() string

func (GitSourceDir) Validate

func (g GitSourceDir) Validate() error

Validates wheather the path exists and is a directory

type GopierOptions

type GopierOptions struct {
	DryRun       bool
	TemplatePath string
	TemplateExt  string
}

type LocalDestDir

type LocalDestDir struct {
	// contains filtered or unexported fields
}

func (LocalDestDir) AbsPath

func (l LocalDestDir) AbsPath() string

func (LocalDestDir) Path

func (l LocalDestDir) Path() string

func (LocalDestDir) Validate

func (l LocalDestDir) Validate() error

type LocalSourceDir

type LocalSourceDir struct {
	// contains filtered or unexported fields
}

func (LocalSourceDir) AbsPath

func (l LocalSourceDir) AbsPath() string

func (LocalSourceDir) Bootstrap

func (l LocalSourceDir) Bootstrap() error

func (LocalSourceDir) Finalize

func (l LocalSourceDir) Finalize(context Context, rollback bool, err error) error

func (LocalSourceDir) HooksAbsPath

func (l LocalSourceDir) HooksAbsPath() string

func (LocalSourceDir) Path

func (l LocalSourceDir) Path() string

func (LocalSourceDir) TemplateAbsPath

func (l LocalSourceDir) TemplateAbsPath() string

func (LocalSourceDir) Validate

func (l LocalSourceDir) Validate() error

Validates wheather the path exists and is a directory

type RenderItem

type RenderItem struct {
	Dir     string
	Name    string
	Content []byte
	Append  bool
	IsDir   bool
}

type Runner

type Runner interface {
	Run(context Context) error
}

type SourceDir

type SourceDir interface {
	Path() string
	AbsPath() string
	Validate() error
	Bootstrap() error
	Finalize(context Context, rollback bool, err error) error
	TemplateAbsPath() string
	HooksAbsPath() string
}

func CreateSourceDir

func CreateSourceDir(src string) SourceDir

type TemplateContext

type TemplateContext struct {
	Values map[interface{}]interface{}
}

func CreateTemplateContext

func CreateTemplateContext(defaultValuesPath string, valuesPath string) (*TemplateContext, error)

type ValuesMap

type ValuesMap = map[interface{}]interface{}

Jump to

Keyboard shortcuts

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