Documentation
¶
Index ¶
- Constants
- type Detail
- type List
- func (list *List) Clear()
- func (list *List) DeleteTaskByID(ID int) (Task, error)
- func (list *List) GetTaskByID(ID int) (Task, error)
- func (list *List) GetTaskDetailByID(ID int) (interface{}, error)
- func (list *List) GetTaskOutputByID(ID int) (string, error)
- func (list *List) GetTaskReturnValueByID(ID int) (*ProcessReturnValue, error)
- func (list *List) GetTasks() []Task
- func (list *List) RunTaskInBackground(name string, resources []string, process Process) (Task, *ResourceConflictError)
- func (list *List) Wait()
- func (list *List) WaitForTaskByID(ID int) (Task, error)
- type Output
- func (t *Output) AddBar(count int)
- func (t *Output) ColoredPrintf(msg string, a ...interface{})
- func (t *Output) Flush()
- func (t *Output) InitBar(count int64, isBytes bool, barType aptly.BarType)
- func (t *Output) Print(msg string)
- func (t *Output) Printf(msg string, a ...interface{})
- func (t *Output) PrintfStdErr(msg string, a ...interface{})
- func (t *Output) SetBar(count int)
- func (t *Output) Shutdown()
- func (t *Output) ShutdownBar()
- func (t *Output) Start()
- func (t *Output) String() string
- func (t *Output) Write(p []byte) (n int, err error)
- func (t *Output) WriteString(s string) (n int, err error)
- type Process
- type ProcessReturnValue
- type PublishDetail
- type PublishOutput
- type ResourceConflictError
- type ResourcesSet
- type State
- type Task
Constants ¶
const AllLocalReposResourcesKey = "__alllocalrepos__"
AllLocalReposResourcesKey to be used as resource key when all local repos are needed
const AllResourcesKey = "__all__"
AllResourcesKey to be used as resource key when all resources are needed
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type List ¶
List is handling list of processes and makes sure only one process is executed at the time
func (*List) DeleteTaskByID ¶
DeleteTaskByID deletes given task from list. Only finished tasks can be deleted.
func (*List) GetTaskByID ¶
GetTaskByID returns task with given id
func (*List) GetTaskDetailByID ¶
GetTaskDetailByID returns detail of task with given id
func (*List) GetTaskOutputByID ¶
GetTaskOutputByID returns standard output of task with given id
func (*List) GetTaskReturnValueByID ¶
func (list *List) GetTaskReturnValueByID(ID int) (*ProcessReturnValue, error)
GetTaskReturnValueByID returns process return value of task with given id
func (*List) RunTaskInBackground ¶
func (list *List) RunTaskInBackground(name string, resources []string, process Process) (Task, *ResourceConflictError)
RunTaskInBackground creates task and runs it in background. It won't be run and an error returned if there are running tasks which are using needed resources already.
type Output ¶
type Output struct {
// contains filtered or unexported fields
}
Output represents a safe standard output of task which is compatbile to AptlyProgress.
func (*Output) ColoredPrintf ¶
ColoredPrintf does printf in a safe manner + newline currently are no colors supported.
func (*Output) PrintfStdErr ¶
PrintfStdErr does printf but in safe manner to output
func (*Output) ShutdownBar ¶
func (t *Output) ShutdownBar()
ShutdownBar is needed for progress compatibility
type Process ¶
type Process func(out aptly.Progress, detail *Detail) (*ProcessReturnValue, error)
Process is a function implementing the actual task logic
type ProcessReturnValue ¶
type ProcessReturnValue struct { Code int Value interface{} }
type PublishDetail ¶
PublishDetail represents publish task details
type PublishOutput ¶
type PublishOutput struct { aptly.Progress PublishDetail // contains filtered or unexported fields }
PublishOutput specific output for publishing api
func (*PublishOutput) AddBar ¶
func (t *PublishOutput) AddBar(count int)
AddBar publish output specific
func (*PublishOutput) InitBar ¶
func (t *PublishOutput) InitBar(count int64, isBytes bool, barType aptly.BarType)
InitBar publish output specific
func (*PublishOutput) ShutdownBar ¶
func (t *PublishOutput) ShutdownBar()
ShutdownBar publish output specific
type ResourceConflictError ¶
ResourceConflictError represents a list tasks using conflicitng resources
func (*ResourceConflictError) Error ¶
func (e *ResourceConflictError) Error() string
type ResourcesSet ¶
type ResourcesSet struct {
// contains filtered or unexported fields
}
ResourcesSet represents a set of task resources. A resource is represented by its unique key
func NewResourcesSet ¶
func NewResourcesSet() *ResourcesSet
NewResourcesSet creates new instance of resources set
func (*ResourcesSet) Free ¶
func (r *ResourcesSet) Free(resources []string)
Free removes given resources from dependency set
func (*ResourcesSet) MarkInUse ¶
func (r *ResourcesSet) MarkInUse(resources []string, task *Task)
MarkInUse given resources as used by given task
func (*ResourcesSet) UsedBy ¶
func (r *ResourcesSet) UsedBy(resources []string) []Task
UsedBy checks whether one of given resources is used by a task and if yes returns slice of such task