datastore

package
v0.0.0-...-a1c7d3d Latest Latest
Warning

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

Go to latest
Published: May 9, 2020 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlreadyAssigned

type AlreadyAssigned struct{}

func (AlreadyAssigned) Error

func (err AlreadyAssigned) Error() string

type AlreadyHasSettings

type AlreadyHasSettings struct{}

func (AlreadyHasSettings) Error

func (err AlreadyHasSettings) Error() string

type AssignmentNotFound

type AssignmentNotFound struct {
	ID         string
	WorkerID   uint64
	JobID      uint64
	ResponseID uint64
}

func (AssignmentNotFound) Error

func (err AssignmentNotFound) Error() string

type AssignmentStore

type AssignmentStore struct {
	DB *sqlx.DB
}

func NewAssignmentStore

func NewAssignmentStore(db *sqlx.DB) *AssignmentStore

func (*AssignmentStore) CreateAssignment

func (as *AssignmentStore) CreateAssignment(a assignment.NewAssignment) (*assignment.Assignment, error)

func (*AssignmentStore) CreateSettings

func (as *AssignmentStore) CreateSettings(s assignment.Settings) (*assignment.Settings, error)

func (*AssignmentStore) DeleteAssignment

func (as *AssignmentStore) DeleteAssignment(id string) (bool, error)

func (*AssignmentStore) DeleteAssignments

func (as *AssignmentStore) DeleteAssignments(ids []string) error

func (*AssignmentStore) GetAssignment

func (as *AssignmentStore) GetAssignment(id string) (*assignment.Assignment, error)

func (*AssignmentStore) GetAssignments

func (as *AssignmentStore) GetAssignments(p assignment.Params) (assignment.Assignments, error)

func (*AssignmentStore) GetSettings

func (as *AssignmentStore) GetSettings(jobID uint64) (*assignment.Settings, error)

func (*AssignmentStore) GetWhitelist

func (as *AssignmentStore) GetWhitelist(jobID uint64, workerID uint64) (*whitelist.Whitelist, error)

func (*AssignmentStore) SelectExpiredAssignments

func (as *AssignmentStore) SelectExpiredAssignments() (assignment.Assignments, error)

func (*AssignmentStore) UpdateAssignment

func (as *AssignmentStore) UpdateAssignment(workerID, jobID, responseID uint64, status string) (bool, error)

func (*AssignmentStore) WorkerAlreadyAssigned

func (as *AssignmentStore) WorkerAlreadyAssigned(jobID uint64, workerID uint64) (bool, error)

type NoRowErr

type NoRowErr struct{}

func (NoRowErr) Error

func (err NoRowErr) Error() string

type RecordsMismatch

type RecordsMismatch struct{}

func (RecordsMismatch) Error

func (err RecordsMismatch) Error() string

type Storage

type Storage interface {
	GetAssignments(assignment.Params) (assignment.Assignments, error)
	GetAssignment(id string) (*assignment.Assignment, error)
	CreateAssignment(assignment.NewAssignment) (*assignment.Assignment, error)
	GetSettings(jobID uint64) (*assignment.Settings, error)
	GetWhitelist(jobID uint64, workerID uint64) (*whitelist.Whitelist, error)
	WorkerAlreadyAssigned(jobID uint64, workerID uint64) (bool, error)
	DeleteAssignment(id string) (bool, error)
	DeleteAssignments(ids []string) error
	UpdateAssignment(workerID, jobID, responseID uint64, status string) (bool, error)
	CreateSettings(assignment.Settings) (*assignment.Settings, error)
	SelectExpiredAssignments() (assignment.Assignments, error)
}

Jump to

Keyboard shortcuts

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