Documentation
¶
Overview ¶
Package crontest holds the cases every cron job store passes and an in-memory store that passes them.
Index ¶
- func Run(t *testing.T, fresh Factory)
- type Case
- type Factory
- type MemoryStore
- func (m *MemoryStore) LastFailure(_ context.Context, name string) (string, error)
- func (m *MemoryStore) Settle(_ context.Context, lease cron.Lease, outcome cron.Outcome) error
- func (m *MemoryStore) Slots(context.Context) ([]cron.Slot, error)
- func (m *MemoryStore) Take(_ context.Context, lease cron.Lease) (cron.Lease, bool, error)
- type Stores
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
MemoryStore keeps cron jobs and their leases in memory.
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
NewMemoryStore returns an empty in-memory cron job store.
func (*MemoryStore) LastFailure ¶
LastFailure returns the failure the job's last run recorded, empty when it ran well.
func (*MemoryStore) Settle ¶
Settle frees the job and records how its run ended, refusing a lease another run took over.
Click to show internal directories.
Click to hide internal directories.