utils

package
v0.0.0-...-5a015fe Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Copyright © 2022 2kodevs

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteScript

func ExecuteScript(script Script) (out string, err error)

ExecuteScript : Execute the script in the given template.

params :- a. script Script Script object to be executed

returns :- a. string The output of the script. b. error Error if any

func RunCmd

func RunCmd(cmd string, getOutput bool) (out string, err error)

RunCmd : Executes a command and returns the output.

params :- a. cmd string The command to be executed. b. bool getOutput True if the output is to be returned.

returns :- a. string The output of the command. b. error Error if any

func WGet

func WGet(url, filepath string) error

func Workflow

func Workflow(players configs.Players, tmplName string) error

Types

type Script

type Script struct {
	// Tmp : script template
	Tmp *template.Template
	// getOutput : True to get output of the script
	GetOutput bool
	// Data: template data object
	Data interface{}
}

Script : Struct Represents a script to be executed

Jump to

Keyboard shortcuts

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