Documentation
¶
Index ¶
- Constants
- type Config
- type FileMeta
- type Job
- type Store
- func (s *Store) AttemptJob(id string) error
- func (s *Store) Close() error
- func (s *Store) CompleteJob(id string, output []byte) error
- func (s *Store) CreateJob(id string, command string) (*Job, error)
- func (s *Store) DeleteJob(id string) error
- func (s *Store) FailJob(id string) error
- func (st *Store) GetConfig() (conf Config)
- func (st *Store) GetFileMeta(inode uint64) (*FileMeta, error)
- func (s *Store) GetJob(id string) (*Job, error)
- func (s *Store) ListJobsByState(state string) ([]Job, error)
- func (st *Store) PopulateConfig()
- func (s *Store) ResetJob(id string) error
- func (s *Store) RestartJob(id string, output []byte) error
- func (st *Store) UpdateConfig(conf Config) error
- func (st *Store) UpsertFileMeta(meta FileMeta) error
- func (s *Store) WriteOutput(id string, output []byte) error
Constants ¶
View Source
const ( StatePending = "pending" StateRunning = "active" StateCompleted = "complete" StateFailed = "failed" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct {
ID string
State string
INode int
Command string
// Command output on completion
Output []byte
Attempts int
CreatedAt time.Time
UpdatedAt time.Time
}
A single unit of work
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AttemptJob ¶
Picks up a pending job and moves it to 'active'.
func (*Store) PopulateConfig ¶
func (st *Store) PopulateConfig()
func (*Store) RestartJob ¶
Moves a job back to 'pending'.
func (*Store) UpdateConfig ¶
func (*Store) UpsertFileMeta ¶
Click to show internal directories.
Click to hide internal directories.