nomad: helper struct func

This commit is contained in:
Armon Dadgar
2015-09-07 12:23:34 -07:00
parent 5ecb52ecaa
commit 885f6e05bb

View File

@@ -769,6 +769,16 @@ type TaskGroup struct {
Meta map[string]string
}
// LookupTask finds a task by name
func (tg *TaskGroup) LookupTask(name string) *Task {
for _, t := range tg.Tasks {
if t.Name == name {
return t
}
}
return nil
}
// Task is a single process typically that is executed as part of a task group.
type Task struct {
// Name of the task