Documentation
¶
Index ¶
- Variables
- func DeleteChainConfig(name string)
- func DeleteFile(path string) error
- func Load(path string, v interface{}) error
- func PrintStructure(path string)
- func ReadStdin() []byte
- func ResolvePath(path string) string
- func RunLauncherCommand(commandInput string)
- func Save(path string, v interface{}) error
- func SetDefaults()
- type Chain
- func AddChainToChain(chainToAdd Chain, chain Chain) Chain
- func AddScriptToChain(scriptToAdd Script, chain Chain) Chain
- func ClearAutoSave() Chain
- func LoadCustomChain(path string, name string) Chain
- func MaybeAutoSaveChain(chain Chain) Chain
- func ReadChainConfig() Chain
- func RemoveScriptFromChain(scriptToRemove Script, chain Chain) Chain
- func SaveCustomChain(chain Chain, path string, name string) Chain
- type ChainItem
- type ChainResult
- type Script
- type ScriptResult
Constants ¶
This section is empty.
Variables ¶
View Source
var Marshal = func(v interface{}) (io.Reader, error) { b, err := json.MarshalIndent(v, "", "\t") if err != nil { return nil, err } return bytes.NewReader(b), nil }
Marshal is a function that marshals the object into an io.Reader. By default, it uses the JSON marshaller.
View Source
var Unmarshal = func(r io.Reader, v interface{}) error { return json.NewDecoder(r).Decode(v) }
Unmarshal is a function that unmarshals the data from the reader into the specified value. By default, it uses the JSON unmarshaller.
Functions ¶
func DeleteChainConfig ¶
func DeleteChainConfig(name string)
func DeleteFile ¶
func Load ¶
Load loads the file at path into v. Use os.IsNotExist() to see if the returned error is due to the file being missing.
func PrintStructure ¶
func PrintStructure(path string)
func ResolvePath ¶
func RunLauncherCommand ¶
func RunLauncherCommand(commandInput string)
func SetDefaults ¶
func SetDefaults()
Types ¶
type Chain ¶
type Chain []Script
func AddChainToChain ¶
func AddScriptToChain ¶
func ClearAutoSave ¶
func ClearAutoSave() Chain
func LoadCustomChain ¶
func MaybeAutoSaveChain ¶
func ReadChainConfig ¶
func ReadChainConfig() Chain
func RemoveScriptFromChain ¶
type ChainItem ¶
func GetChainStructure ¶
type ChainResult ¶
type ChainResult []ScriptResult
func RunChain ¶
func RunChain(stdin []byte, chain Chain) ChainResult
type ScriptResult ¶
type ScriptResult struct { Script Script //TODO use the exit code to determine success Success bool Stdout []byte Stderr error }
func RunKnownScript ¶
func RunKnownScript(command string, stdin []byte) ScriptResult
func RunScript ¶
func RunScript(script Script, stdin []byte) ScriptResult
TODO Maybe create wrappers around these run functions so that tea can run them without halting the UI
Click to show internal directories.
Click to hide internal directories.