Documentation ¶
Index ¶
- type MemEntry
- type MemStore
- func (s *MemStore) Clear(context.Context) error
- func (s *MemStore) Create(_ context.Context, task *scheduler.StoreTask) error
- func (s *MemStore) Delete(ctx context.Context, slug string) error
- func (s *MemStore) Get(ctx context.Context, slug string) (*scheduler.StoreTask, error)
- func (s *MemStore) GetSlugs(context.Context) ([]string, error)
- func (s *MemStore) Lock(context.Context, *scheduler.StoreTask) (*scheduler.StoreTask, error)
- func (s *MemStore) NextRun(context.Context) (*scheduler.StoreTask, error)
- func (s *MemStore) Reschedule(ctx context.Context, task *scheduler.StoreTask) error
- type PriorityQueue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemStore ¶
type MemStore struct {
// contains filtered or unexported fields
}
MemStore simulates a remote storage. The remote storage is represented by queue that will hold serializable data
type PriorityQueue ¶
type PriorityQueue []*MemEntry
PriorityQueue implements the heap.Interface.
func (*PriorityQueue) Head ¶
func (pq *PriorityQueue) Head() *MemEntry
Head returns the first entry of a PriorityQueue without removing it.
func (PriorityQueue) Less ¶
func (pq PriorityQueue) Less(i, j int) bool
Less is the items less comparator.
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() interface{}
Pop implements the heap.Interface.Pop. Removes and returns element Len() - 1.
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(x interface{})
Push implements the heap.Interface.Push. Adds x as element Len().
func (*PriorityQueue) Remove ¶
func (pq *PriorityQueue) Remove(i int) *MemEntry
Remove removes and returns the element at index i from the PriorityQueue.
func (PriorityQueue) Swap ¶
func (pq PriorityQueue) Swap(i, j int)
Swap exchanges the indexes of the items.
Click to show internal directories.
Click to hide internal directories.