asink

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2014 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CliStart added in v0.0.2

func CliStart() string

*

  • Returns string from cli to start
  • asink *
  • @return String config file name

func GetFirstCliParam added in v0.0.2

func GetFirstCliParam() string

*

  • Gets params and flags from cli
  • and calls appropriate func *
  • @return String

Types

type Command

type Command struct {
	Name          string
	AsyncCount    float64
	RelativeCount float64
	Args          []string
	Dir           string
	Manual        bool
	// contains filtered or unexported fields
}

*

  • @var string name of the command
  • @var float64 number of async iterations
  • @var float64 number of sync iterations
  • @var []string command arguments

func New

func New() *Command

*

  • Acting as a constructor to
  • return a new instance of
  • Command *
  • @return *Command

func (*Command) Execute

func (c *Command) Execute() bool

*

  • Creates the command channel and sets
  • up everything ready for execution *
  • @return bool

func (*Command) ExecuteCommand

func (c *Command) ExecuteCommand(name string, args []string, asyncCount int, relativeCount int) bool

*

  • An alias function that nicely
  • interfaces the Execute function
  • to make it easier to use in external Go
  • programs *
  • @param string the command name
  • @param []string command arguments
  • @param int number of async iterations
  • @param int number of sync iterations *
  • @return bool

func (*Command) ListenForFinish

func (c *Command) ListenForFinish(callback func())

*

  • An optional callback public function
  • that gets called when all jobs have
  • been finished *
  • @param func() callback function *
  • @return nil

func (*Command) ListenForInit

func (c *Command) ListenForInit(callback func(count int))

*

  • An optional callback public function
  • that gets called on job creation *
  • @param func(count int) callback function *
  • @return nil

func (*Command) ListenForProgress

func (c *Command) ListenForProgress(callback func())

*

  • An optional callback public function
  • that gets called everytime a job
  • has finished *
  • @param func() callback function *
  • @return nil

func (*Command) SetManualCallback added in v0.0.2

func (c *Command) SetManualCallback(callback func(command string))

type Task added in v0.0.2

type Task struct {
	Name    string
	Command *Command
	Require string
	Group   string
	Remote  string
}

*

  • @var String task name
  • @var *Command initial command
  • @var String required task name
  • @var String task group name

func NewTask added in v0.0.2

func NewTask() *Task

*

  • Creates a new instance of the Task
  • struct *
  • @return *Task a new task

func (*Task) AddTask added in v0.0.2

func (t *Task) AddTask(name string, command *Command, require string, group string)

*

  • Adds a new tasks to the map *
  • @param String name of task
  • @param *Command the initial command
  • @param String the required task to run
  • @param String the group of tasks to be ran *
  • @return nil

func (*Task) Execute added in v0.0.2

func (t *Task) Execute()

*

  • Runs all tasks, required and grouped *
  • @return nil

func (*Task) SetRemote added in v0.0.2

func (t *Task) SetRemote(name string, remote string)

*

  • Sets a new remote from the ssh block
  • in the JSON config *
  • @param String task name
  • @param String remote name *
  • @return nil

Jump to

Keyboard shortcuts

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