Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyEnvironmentByIdentifier(importLoopData *shared.ImportLoopData, identifierOrPath string, envName string) error
- func ApplyEnvironmentScript(importLoopData *shared.ImportLoopData, script string, scriptPath string) error
- func CheckRuleByIdentifier(importLoopData *shared.ImportLoopData, identifier string, ruleName string) (bool, error)
- func CheckRuleByPath(importLoopData *shared.ImportLoopData, rulesetPath string, ruleName string) (bool, error)
- func CheckRuleScript(importLoopData *shared.ImportLoopData, script string, scriptDirectory string) (bool, error)
- func ExecuteLuaMain(L *lua.LState) (bool, error)
- func ExecuteLuaRevert(L *lua.LState) (bool, error)
- func FetchRuleset(rulesetLocation *RulesetLocation) error
- func GetAllDownloadedRuleSets() ([]string, error)
- func GetDecoratorArguments(decoratorCode string) ([]string, map[string]string, error)
- func GetDefaultRepoPrefix() string
- func GetLuaState(script string, importLoopData *shared.ImportLoopData, ...) (*lua.LState, error)
- func GetRevertRuleFn(infoApi shared.InfoInterface) func(rule vrctFs.Rule) error
- func GetRevertRuleFnFromScript(infoApi shared.InfoInterface) func(rule vrctFs.Rule) error
- func GetRuleConfFromScriptPath(scriptPath string) (shared.RuleConfigLayout, error)
- func GetRulesetConf(rulesetLocation *RulesetLocation) (shared.ConfigFileLayout, error)
- func InstallDependency(ruleIdentifier string, waitGroup *sync.WaitGroup, errChan chan error)
- func ReadSpitoYaml(rulesetLocation *RulesetLocation) ([]byte, error)
- type AppliedEnvironment
- type AppliedEnvironments
- type DecoratorType
- type DependencyTreeLayout
- type LuaNamespace
- type RawDecorator
- type Rule
- type RulesHistory
- type RulesetLocation
Constants ¶
View Source
const ( UnsafeDecorator = iota DescriptionDecorator OptionsDecorator EnvironmentDecorator SudoDecorator UnknownDecorator )
Variables ¶
View Source
var EnvironmentDataPath = filepath.Join(shared.LocalStateSpitoPath, "environment-data.json")
View Source
var NotEnvironmentErr = errors.New("called rule is not an environment")
Functions ¶
func ApplyEnvironmentByIdentifier ¶
func ApplyEnvironmentByIdentifier(importLoopData *shared.ImportLoopData, identifierOrPath string, envName string) error
func ApplyEnvironmentScript ¶
func ApplyEnvironmentScript(importLoopData *shared.ImportLoopData, script string, scriptPath string) error
func CheckRuleByIdentifier ¶
func CheckRuleByPath ¶
func CheckRuleScript ¶
func ExecuteLuaMain ¶
func ExecuteLuaRevert ¶
func FetchRuleset ¶
func FetchRuleset(rulesetLocation *RulesetLocation) error
func GetDecoratorArguments ¶
func GetDefaultRepoPrefix ¶
func GetDefaultRepoPrefix() string
func GetLuaState ¶
func GetLuaState(script string, importLoopData *shared.ImportLoopData, ruleConf *shared.RuleConfigLayout, rulesetPath string) (*lua.LState, error)
func GetRevertRuleFn ¶
func GetRevertRuleFn(infoApi shared.InfoInterface) func(rule vrctFs.Rule) error
func GetRevertRuleFnFromScript ¶
func GetRevertRuleFnFromScript(infoApi shared.InfoInterface) func(rule vrctFs.Rule) error
func GetRuleConfFromScriptPath ¶
func GetRuleConfFromScriptPath(scriptPath string) (shared.RuleConfigLayout, error)
func GetRulesetConf ¶
func GetRulesetConf(rulesetLocation *RulesetLocation) (shared.ConfigFileLayout, error)
func InstallDependency ¶
func ReadSpitoYaml ¶
func ReadSpitoYaml(rulesetLocation *RulesetLocation) ([]byte, error)
Types ¶
type AppliedEnvironment ¶
type AppliedEnvironments ¶
type AppliedEnvironments []*AppliedEnvironment
func ReadAppliedEnvironments ¶
func ReadAppliedEnvironments() (AppliedEnvironments, error)
func (*AppliedEnvironments) RevertOther ¶
func (e *AppliedEnvironments) RevertOther(importLoopData *shared.ImportLoopData, envIdentifierOrPath string) error
func (*AppliedEnvironments) Save ¶
func (e *AppliedEnvironments) Save() error
func (*AppliedEnvironments) SetAsApplied ¶
func (e *AppliedEnvironments) SetAsApplied(envIdentifierOrPath string, revertNum int)
type DecoratorType ¶
type DecoratorType uint
func GetDecoratorType ¶
func GetDecoratorType(name string) (DecoratorType, error)
type DependencyTreeLayout ¶
type LuaNamespace ¶
type LuaNamespace struct {
// contains filtered or unexported fields
}
func (LuaNamespace) AddField ¶
func (ln LuaNamespace) AddField(name string, field lua.LValue)
func (LuaNamespace) AddFn ¶
func (ln LuaNamespace) AddFn(name string, fn interface{})
type RawDecorator ¶
type RawDecorator struct { Type DecoratorType Content string }
func GetDecorators ¶
func GetDecorators(script string) (string, []RawDecorator, error)
GetDecorators Returns script without decorators and array of decorator values
type RulesHistory ¶
func (RulesHistory) IsRuleInProgress ¶
func (r RulesHistory) IsRuleInProgress(url string, name string) bool
func (RulesHistory) SetProgress ¶
func (r RulesHistory) SetProgress(url string, name string, isInProgress bool)
type RulesetLocation ¶
type RulesetLocation struct { IsPath bool // contains filtered or unexported fields }
RulesetLocation represent enum with value, only one of fields must be set
func NewRulesetLocation ¶
func NewRulesetLocation(identifierOrPath string, isPath bool) (RulesetLocation, error)
NewRulesetLocation e.g., from: https://github.com/avorty/spito-ruleset.git to avorty/spito-ruleset
func (*RulesetLocation) CreateDir ¶
func (r *RulesetLocation) CreateDir() error
func (*RulesetLocation) GetFullUrl ¶
func (r *RulesetLocation) GetFullUrl() *string
func (*RulesetLocation) GetIdentifier ¶
func (r *RulesetLocation) GetIdentifier() string
func (*RulesetLocation) GetRulesetPath ¶
func (r *RulesetLocation) GetRulesetPath() string
func (*RulesetLocation) IsRuleSetDownloaded ¶
func (r *RulesetLocation) IsRuleSetDownloaded() bool
Click to show internal directories.
Click to hide internal directories.