queue

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedQueueRepository

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

CachedQueueRepository is an implementation of ReadOnlyQueueRepository that fetches ques periodically and caches them. This means the queue information may be slightly out of date but allows us to continue api operations even if the queue is unavailable

func NewCachedQueueRepository

func NewCachedQueueRepository(underlyingRepo QueueRepository, updateFrequency time.Duration) *CachedQueueRepository

func (*CachedQueueRepository) GetAllQueues

func (c *CachedQueueRepository) GetAllQueues(_ *armadacontext.Context) ([]queue.Queue, error)

func (*CachedQueueRepository) GetQueue

func (*CachedQueueRepository) Run

type ErrQueueAlreadyExists

type ErrQueueAlreadyExists struct {
	QueueName string
}

func (*ErrQueueAlreadyExists) Error

func (err *ErrQueueAlreadyExists) Error() string

type ErrQueueNotFound

type ErrQueueNotFound struct {
	QueueName string
}

func (*ErrQueueNotFound) Error

func (err *ErrQueueNotFound) Error() string

type PostgresQueueRepository

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

func NewPostgresQueueRepository

func NewPostgresQueueRepository(db *pgxpool.Pool) *PostgresQueueRepository

func (*PostgresQueueRepository) CreateQueue

func (r *PostgresQueueRepository) CreateQueue(ctx *armadacontext.Context, queue queue.Queue) error

func (*PostgresQueueRepository) DeleteQueue

func (r *PostgresQueueRepository) DeleteQueue(ctx *armadacontext.Context, name string) error

func (*PostgresQueueRepository) GetAllQueues

func (r *PostgresQueueRepository) GetAllQueues(ctx *armadacontext.Context) ([]queue.Queue, error)

func (*PostgresQueueRepository) GetQueue

func (*PostgresQueueRepository) UpdateQueue

func (r *PostgresQueueRepository) UpdateQueue(ctx *armadacontext.Context, queue queue.Queue) error

type QueueRepository

type QueueRepository interface {
	GetAllQueues(ctx *armadacontext.Context) ([]queue.Queue, error)
	GetQueue(ctx *armadacontext.Context, name string) (queue.Queue, error)
	CreateQueue(*armadacontext.Context, queue.Queue) error
	UpdateQueue(*armadacontext.Context, queue.Queue) error
	DeleteQueue(ctx *armadacontext.Context, name string) error
}

type ReadOnlyQueueRepository

type ReadOnlyQueueRepository interface {
	GetAllQueues(ctx *armadacontext.Context) ([]queue.Queue, error)
	GetQueue(ctx *armadacontext.Context, name string) (queue.Queue, error)
}

type Server

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

func NewServer

func NewServer(
	queueRepository QueueRepository,
	authorizer auth.ActionAuthorizer,
) *Server

func (*Server) CreateQueue

func (s *Server) CreateQueue(grpcCtx context.Context, req *api.Queue) (*types.Empty, error)

func (*Server) CreateQueues

func (s *Server) CreateQueues(grpcCtx context.Context, req *api.QueueList) (*api.BatchQueueCreateResponse, error)

func (*Server) DeleteQueue

func (s *Server) DeleteQueue(grpcCtx context.Context, req *api.QueueDeleteRequest) (*types.Empty, error)

func (*Server) GetQueue

func (s *Server) GetQueue(grpcCtx context.Context, req *api.QueueGetRequest) (*api.Queue, error)

func (*Server) GetQueues

func (*Server) UpdateQueue

func (s *Server) UpdateQueue(grpcCtx context.Context, req *api.Queue) (*types.Empty, error)

func (*Server) UpdateQueues

func (s *Server) UpdateQueues(grpcCtx context.Context, req *api.QueueList) (*api.BatchQueueUpdateResponse, error)

Jump to

Keyboard shortcuts

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