mirror of
https://github.com/kemko/nomad.git
synced 2026-01-09 03:45:41 +03:00
nomad: helper struct func
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user