key

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

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

Key returns the correct namespaced key for the given object name.

func New

func New(opts Options) *Key

New returns a new Key with the given namespace.

func (*Key) CounterKey

func (k *Key) CounterKey(name string) string

CounterKey returns the counter key for the given job name.

func (*Key) JobKey

func (k *Key) JobKey(name string) string

JobKey returns the job key for the given job name.

func (*Key) JobName

func (k *Key) JobName(key []byte) string

JobName returns the job name from the given key.

func (*Key) JobNamespace

func (k *Key) JobNamespace() string

JobNamespace returns the job namespace key.

func (*Key) LeadershipKey

func (k *Key) LeadershipKey() string

LeadershipKey returns the leadership key for this partition ID.

func (*Key) LeadershipNamespace

func (k *Key) LeadershipNamespace() string

LeadershipNamespace returns the namespace key for the leadership keys.

type Options

type Options struct {
	// Namespace is the key namespace of all objects. Should be the same for all
	// cron partition replicas.
	Namespace string

	// PartitionID is the partition ID of the key.
	PartitionID uint32
}

Jump to

Keyboard shortcuts

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