task

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClosed         = errors.New("closed")
	ErrDBFailed       = errors.New("DB failed")
	ErrDBNotFound     = errors.New("DB not found")
	ErrDBInvalidIndex = errors.New("DB invalid index")
	ErrEmpty          = errors.New("empty")
	ErrInvalidRequest = errors.New("invalid request")
	ErrNotFound       = errors.New("not found")
	ErrRetry          = errors.New("retry")
)

Functions

This section is empty.

Types

type ID

type ID uint64

func NewID

func NewID() ID

type Notificator

type Notificator interface {
	Wait(context.Context) error
	Close(context.Context) error
	Notify() error
}

Notificator common implementation located at:

"github.com/opoccomaxao-go/task-server/notificator".

type Storage

type Storage interface {
	Create(Task) error
	Update(Task) error
	// if no documents ErrEmpty should be returned.
	FirstToExecute() (*Task, error)
	Watch() (Notificator, error)
	Close() error
}

Storage common implementation located at:

"github.com/opoccomaxao-go/task-server/storage".

type Task

type Task struct {
	ID         ID
	Expiration time.Time
	Executed   bool
	Data       json.RawMessage
}

Jump to

Keyboard shortcuts

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