key

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 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, error)

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) ID added in v0.4.0

func (k *Key) ID() string

ID returns the replica ID.

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 replica 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 the
	// cron partition replica cluster.
	Namespace string

	// ID is the unique identifier for this replica.
	ID string
}

Jump to

Keyboard shortcuts

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