github.com/leg100/ots@v0.0.7-0.20210919080622-034055ced4bd/agent/mock/job.go (about)

     1  /*
     2  Package mock provides mocks for the parent agent package
     3  */
     4  package mock
     5  
     6  import (
     7  	"github.com/leg100/ots"
     8  )
     9  
    10  type Job struct {
    11  	ID     string
    12  	Status string
    13  	DoFn   func(*ots.Executor) error
    14  }
    15  
    16  func (j *Job) Do(exe *ots.Executor) error {
    17  	return j.DoFn(exe)
    18  }
    19  
    20  func (j *Job) GetID() string {
    21  	return j.ID
    22  }
    23  
    24  func (j *Job) GetStatus() string {
    25  	return j.Status
    26  }