config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTargetExcluded     error = errors.New("target entity itself is excluded")
	ErrCircularDependency error = CircularDependencyError{}
)

Functions

func GetAdapter

func GetAdapter(adapter string) model.Adapter

func IsReservedKey

func IsReservedKey(key string) bool

func IsValidRunMode

func IsValidRunMode(key string) bool

func NewContext

func NewContext(opts LoadOptions) loadingContext

Types

type CircularDependencyError

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

func (CircularDependencyError) Error

func (e CircularDependencyError) Error() string

func (CircularDependencyError) Is

func (e CircularDependencyError) Is(target error) bool

type Compound

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

func (Compound) Name

func (c Compound) Name() string

func (Compound) ResolveConfig

func (c Compound) ResolveConfig() ResolvedCompound

type Config

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

func Load

func Load(path string) (Config, error)

func New

func New(dir string, content map[string]interface{}) (Config, error)

func NewLoaded

func NewLoaded(profiles []Profile, fragments []Fragment, compounds []Compound) Config

func (Config) GetCompounds

func (c Config) GetCompounds() []Compound

func (Config) GetFragments

func (c Config) GetFragments() []Fragment

func (Config) GetProfiles

func (c Config) GetProfiles() []Profile

func (Config) LoadCompound

func (c Config) LoadCompound(key string, ctx loadingContext) (tasks.Collection, error)

func (Config) LoadFragment

func (c Config) LoadFragment(rawKey string, ctx loadingContext) (*tasks.TaskTreeNode, error)

func (Config) LoadProfile

func (c Config) LoadProfile(key, mode string, ctx loadingContext) (tasks.Collection, error)

type Fragment

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

func (Fragment) Name

func (f Fragment) Name() string

func (Fragment) ResolveConfig

func (f Fragment) ResolveConfig(mode string, callingProfile string) (ResolvedFragment, error)

type Hook

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

func (Hook) ResolveWithCompound

func (h Hook) ResolveWithCompound(callingCompound ResolvedCompound, kind string) ResolvedHook

func (Hook) ResolveWithFragment

func (h Hook) ResolveWithFragment(callingFragment ResolvedFragment, kind string) ResolvedHook

func (Hook) ResolveWithProfile

func (h Hook) ResolveWithProfile(callingProfile ResolvedProfile, kind string) ResolvedHook

type Hookable

type Hookable interface {
	ResolvePreHook() ResolvedHook
	ResolvePostHook() ResolvedHook
}

type LoadOptions

type LoadOptions struct {
	SkipHooks bool
	Exclude   []string
	ExtraArgs []string
}

type Profile

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

func (Profile) Name

func (p Profile) Name() string

func (Profile) ResolveConfig

func (p Profile) ResolveConfig(mode string) (ResolvedProfile, error)

type ResolvedCompound

type ResolvedCompound struct {
	Name             string
	Directory        string
	Profiles         map[string]string
	IncludeFragments []string
	Options          map[string]interface{}
}

func (ResolvedCompound) ResolvePostHook

func (c ResolvedCompound) ResolvePostHook() ResolvedHook

func (ResolvedCompound) ResolvePreHook

func (c ResolvedCompound) ResolvePreHook() ResolvedHook

type ResolvedFragment

type ResolvedFragment struct {
	Name       string
	Directory  string
	Command    string
	ProfileKey string
	Mode       string
	Options    map[string]interface{}
}

func (ResolvedFragment) GetTask

func (r ResolvedFragment) GetTask(extraArgs []string) tasks.Task

func (ResolvedFragment) GetTaskWithBaseName

func (r ResolvedFragment) GetTaskWithBaseName(baseName string, extraArgs []string) tasks.Task

func (ResolvedFragment) ResolvePostHook

func (r ResolvedFragment) ResolvePostHook() ResolvedHook

func (ResolvedFragment) ResolvePreHook

func (r ResolvedFragment) ResolvePreHook() ResolvedHook

type ResolvedHook

type ResolvedHook struct {
	Kind      string
	Command   string
	Fragments []string
	Profiles  map[string]string
	Base      string
	Directory string
}

func (ResolvedHook) GetTask

func (r ResolvedHook) GetTask() tasks.Task

type ResolvedProfile

type ResolvedProfile struct {
	Name      string
	Mode      string
	Adapter   string
	Directory string
	Options   map[string]interface{}
}

func (ResolvedProfile) GetAdapter

func (r ResolvedProfile) GetAdapter() string

func (ResolvedProfile) GetBaseOptions

func (r ResolvedProfile) GetBaseOptions() model.BaseOptions

func (ResolvedProfile) GetDirectory

func (r ResolvedProfile) GetDirectory() string

func (ResolvedProfile) GetDotNetOptions

func (r ResolvedProfile) GetDotNetOptions() model.DotNetOptions

func (ResolvedProfile) GetMode

func (r ResolvedProfile) GetMode() string

func (ResolvedProfile) GetName

func (r ResolvedProfile) GetName() string

func (ResolvedProfile) GetOptions

func (r ResolvedProfile) GetOptions() map[string]interface{}

func (ResolvedProfile) GetProfileOptions

func (r ResolvedProfile) GetProfileOptions() model.ProfileOptions

func (ResolvedProfile) GetTask

func (r ResolvedProfile) GetTask(args []string) (tasks.Task, error)

func (ResolvedProfile) GetViteOptions

func (r ResolvedProfile) GetViteOptions() model.ViteOptions

func (ResolvedProfile) ResolvePostHook

func (r ResolvedProfile) ResolvePostHook() ResolvedHook

func (ResolvedProfile) ResolvePreHook

func (r ResolvedProfile) ResolvePreHook() ResolvedHook

Jump to

Keyboard shortcuts

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