queues

package
v0.0.0-...-70b330c Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LaunchQueueRepository

type LaunchQueueRepository struct {
	// contains filtered or unexported fields
}

LaunchQueueRepository represents the Launch Queue Data Access Object

func NewLaunchQueueRepository

func NewLaunchQueueRepository() (lq *LaunchQueueRepository)

NewLaunchQueueRepository returns a new LaunchQueueRepository instance.

func (*LaunchQueueRepository) Count

func (lq *LaunchQueueRepository) Count() int

Count returns the length of the underlying queue's slice

func (*LaunchQueueRepository) Dequeue

func (lq *LaunchQueueRepository) Dequeue() (interface{}, *ign.ErrMsg)

Dequeue returns the next groupID from the queue.

func (*LaunchQueueRepository) DequeueOrWait

func (lq *LaunchQueueRepository) DequeueOrWait() (interface{}, *ign.ErrMsg)

DequeueOrWait returns the next groupID from the queue or waits until there is one available.

func (*LaunchQueueRepository) Enqueue

func (lq *LaunchQueueRepository) Enqueue(entity interface{}) interface{}

Enqueue enqueues a groupID on the queue. Returns the groupID that was pushed.

func (*LaunchQueueRepository) Get

func (lq *LaunchQueueRepository) Get(offset, limit *int) ([]interface{}, *ign.ErrMsg)

Get returns the entire launch queue. If `offset` and `limit` are not nil, it will return up to `limit` results from the provided `offset`.

func (*LaunchQueueRepository) MoveToBack

func (lq *LaunchQueueRepository) MoveToBack(target interface{}) (interface{}, *ign.ErrMsg)

MoveToBack moves a target element to the front of the queue.

func (*LaunchQueueRepository) MoveToFront

func (lq *LaunchQueueRepository) MoveToFront(target interface{}) (interface{}, *ign.ErrMsg)

MoveToFront moves a target groupID to the front of the queue.

func (*LaunchQueueRepository) Remove

func (lq *LaunchQueueRepository) Remove(id interface{}) (interface{}, *ign.ErrMsg)

Remove removes a groupID from the queue.

func (*LaunchQueueRepository) Swap

func (lq *LaunchQueueRepository) Swap(a interface{}, b interface{}) (interface{}, *ign.ErrMsg)

Swap switch places between groupID A and groupID B.

type QueueItemResponse

type QueueItemResponse struct {
	GroupID string
}

QueueItemResponse represents a response from the queue service.

type QueueRepository

type QueueRepository interface {
	Get(offset, limit *int) ([]interface{}, *ign.ErrMsg)
	Enqueue(entity interface{}) interface{}
	Dequeue() (interface{}, *ign.ErrMsg)
	DequeueOrWait() (interface{}, *ign.ErrMsg)
	MoveToFront(target interface{}) (interface{}, *ign.ErrMsg)
	MoveToBack(target interface{}) (interface{}, *ign.ErrMsg)
	Swap(a interface{}, b interface{}) (interface{}, *ign.ErrMsg)
	Remove(id interface{}) (interface{}, *ign.ErrMsg)
	Count() int
	// contains filtered or unexported methods
}

QueueRepository represents a set of methods to interact with the queue

type SwapResponse

type SwapResponse struct {
	// contains filtered or unexported fields
}

SwapResponse represents a response from the Swap method.

Jump to

Keyboard shortcuts

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