apiserver

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LabelQueueName is the label representing queue name.
	LabelQueueName = "ucp.dev/queuename"
	// LabelNextVisibleAt is the label representing the time when message is visible in the queue or requeued.
	LabelNextVisibleAt = "ucp.dev/nextvisibleat"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the queue client used for dev and test purpose.

func New

func New(client runtimeclient.Client, options Options) (*Client, error)

New creates the queue backed by Kubernetes API server KV store. name is unique name for each service which will consume the queue.

func (*Client) Dequeue

func (c *Client) Dequeue(ctx context.Context, opts client.QueueClientConfig) (*client.Message, error)

func (*Client) Enqueue

func (c *Client) Enqueue(ctx context.Context, msg *client.Message, options ...client.EnqueueOptions) error

func (*Client) ExtendMessage

func (c *Client) ExtendMessage(ctx context.Context, msg *client.Message) error

func (*Client) FinishMessage

func (c *Client) FinishMessage(ctx context.Context, msg *client.Message) error

type Options

type Options struct {
	// Name represents the name of queue.
	Name string
	// Namespace represents the namespace of kubernetes cluster.
	Namespace string

	// MessageLockDuration represents the duration of message lock.
	MessageLockDuration time.Duration
	// ExpiryDuration represents the duration of the expiry.
	ExpiryDuration time.Duration
}

Options is the options to create apiserver queue client.

Jump to

Keyboard shortcuts

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