service

package
v0.0.0-...-9bdd25a Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2016 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(ws *websocket.Conn) *Connection

func (*Connection) Reader

func (c *Connection) Reader()

func (*Connection) Writer

func (c *Connection) Writer()

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

func NewExecutor

func NewExecutor(jobList *JobList, taskList *TaskList, runList *RunList) *Executor

func (Executor) ArmTrigger

func (e Executor) ArmTrigger(t Trigger)

func (Executor) DisarmTrigger

func (e Executor) DisarmTrigger(name string)

type Hub

type Hub struct {
	// contains filtered or unexported fields
}

func NewHub

func NewHub(runList *RunList) *Hub

func (*Hub) HubLoop

func (h *Hub) HubLoop()

func (*Hub) Refresh

func (h *Hub) Refresh()

func (*Hub) Register

func (h *Hub) Register(c *Connection)

func (*Hub) Unregister

func (h *Hub) Unregister(c *Connection)

type Job

type Job struct {
	Name     string   `json:"name"`
	Tasks    []string `json:"tasks"`
	Status   string   `json:"status"`
	Triggers []string `json:"triggers"`
}

func (*Job) AppendTask

func (j *Job) AppendTask(task string)

func (*Job) AppendTrigger

func (j *Job) AppendTrigger(trigger string) error

func (*Job) DeleteTask

func (j *Job) DeleteTask(taskPosition int) error

func (*Job) DeleteTrigger

func (j *Job) DeleteTrigger(trigger string) error

func (Job) ID

func (j Job) ID() string

type JobList

type JobList struct {
	// contains filtered or unexported fields
}

func NewJobList

func NewJobList() *JobList

func (*JobList) Append

func (l *JobList) Append(e elementer) error

func (*JobList) Delete

func (l *JobList) Delete(id string) error

func (*JobList) Dump

func (l *JobList) Dump() []elementer

func (*JobList) Get

func (l *JobList) Get(id string) (elementer, error)

func (*JobList) GetJobsWithTask

func (l *JobList) GetJobsWithTask(taskName string) (jobs []Job)

func (*JobList) GetJobsWithTrigger

func (l *JobList) GetJobsWithTrigger(triggerName string) (jobs []Job)

func (*JobList) Load

func (l *JobList) Load()

func (*JobList) Update

func (l *JobList) Update(e elementer) error

type ListReader

type ListReader func(string) []byte

type ListWriter

type ListWriter func([]byte, string)

type OutputHolder

type OutputHolder bytes.Buffer

An alias of Buffer that json encoder will marshal to a string and unmarshal from a string.

func (*OutputHolder) MarshalJSON

func (holder *OutputHolder) MarshalJSON() ([]byte, error)

func (*OutputHolder) Reset

func (holder *OutputHolder) Reset()

func (*OutputHolder) String

func (holder *OutputHolder) String() string

func (*OutputHolder) UnmarshalJSON

func (holder *OutputHolder) UnmarshalJSON(data []byte) error

func (*OutputHolder) WriteString

func (holder *OutputHolder) WriteString(s string) (int, error)

type Result

type Result struct {
	Start  time.Time    `json:"start"`
	End    time.Time    `json:"end"`
	Task   Task         `json:"task"`
	Output OutputHolder `json:"output"`
	Error  string       `json:"error"`
}

type Reverse

type Reverse struct {
	sort.Interface
}

func (Reverse) Less

func (r Reverse) Less(i, j int) bool

type Run

type Run struct {
	UUID    string    `json:"uuid"`
	Job     Job       `json:"job"`
	Tasks   []Task    `json:"tasks"`
	Start   time.Time `json:"start"`
	End     time.Time `json:"end"`
	Results []*Result `json:"results"`
	Status  string    `json:"status"`
}

func (Run) ID

func (r Run) ID() string

type RunList

type RunList struct {
	// contains filtered or unexported fields
}

func NewRunList

func NewRunList(jobList *JobList) *RunList

func (*RunList) AddRun

func (j *RunList) AddRun(UUID string, job Job, tasks []Task) error

func (*RunList) Append

func (l *RunList) Append(e elementer) error

func (*RunList) Delete

func (l *RunList) Delete(id string) error

func (*RunList) Dump

func (l *RunList) Dump() []elementer

func (*RunList) Get

func (l *RunList) Get(id string) (elementer, error)

func (RunList) GetRecent

func (l RunList) GetRecent(offset, length int) []elementer

func (*RunList) Len

func (j *RunList) Len() int

func (*RunList) Less

func (l *RunList) Less(i, j int) bool

func (*RunList) Load

func (l *RunList) Load()

func (*RunList) Swap

func (l *RunList) Swap(i, j int)

func (*RunList) Update

func (l *RunList) Update(e elementer) error

type Task

type Task struct {
	Name   string `json:"name"`
	Script string `json:"script"`
}

func (Task) ID

func (t Task) ID() string

type TaskList

type TaskList struct {
	// contains filtered or unexported fields
}

func NewTaskList

func NewTaskList() *TaskList

func (*TaskList) Append

func (l *TaskList) Append(e elementer) error

func (*TaskList) Delete

func (l *TaskList) Delete(id string) error

func (*TaskList) Dump

func (l *TaskList) Dump() []elementer

func (*TaskList) Get

func (l *TaskList) Get(id string) (elementer, error)

func (*TaskList) Load

func (l *TaskList) Load()

func (*TaskList) Update

func (l *TaskList) Update(e elementer) error

type Trigger

type Trigger struct {
	Name     string `json:"name"`
	Schedule string `json:"schedule"`
}

func (Trigger) ID

func (t Trigger) ID() string

type TriggerList

type TriggerList struct {
	// contains filtered or unexported fields
}

func NewTriggerList

func NewTriggerList() *TriggerList

func (*TriggerList) Append

func (l *TriggerList) Append(e elementer) error

func (*TriggerList) Delete

func (l *TriggerList) Delete(id string) error

func (*TriggerList) Dump

func (l *TriggerList) Dump() []elementer

func (*TriggerList) Get

func (l *TriggerList) Get(id string) (elementer, error)

func (*TriggerList) Load

func (l *TriggerList) Load()

func (*TriggerList) Update

func (l *TriggerList) Update(e elementer) error

Jump to

Keyboard shortcuts

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