registry

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Overview

The registry package builds functionality for tracking live controller processes in a NATS KV store. The store is configured with replication and with a default 3 minute TTL for keys. The rationale here is that faulting workers will be reaped by the system, making it easy to determine which workers are active.

nolint: wsl // it's useless

Index

Constants

This section is empty.

Variables

View Source
var (
	RegistryName = "active-controllers"

	ErrRegistryUninitialized         = errors.New("controller registry uninitialized")
	ErrRegistryPreviouslyInitialized = errors.New("controller registry previously initialized")
	ErrBadRegistryData               = errors.New("bad registry data")
)
View Source
var (
	ErrBadFormat = errors.New("bad worker id format")
)

Functions

func ControllerCheckin

func ControllerCheckin(id ControllerID) error

func DeregisterController

func DeregisterController(id ControllerID) error

func InitializeActiveControllerRegistry

func InitializeActiveControllerRegistry(njs *events.NatsJetstream) error

func InitializeRegistryWithOptions

func InitializeRegistryWithOptions(njs *events.NatsJetstream, opts ...kv.Option) error

XXX: You probably don't want the un-opinionated one, but it's here.

func LastContact added in v0.6.1

func LastContact(id ControllerID) (time.Time, error)

func RegisterController

func RegisterController(id ControllerID) error

Types

type ControllerID

type ControllerID interface {
	fmt.Stringer
	// contains filtered or unexported methods
}

func ControllerIDFromString added in v0.6.1

func ControllerIDFromString(s string) (ControllerID, error)

func GetID

func GetID(app string) ControllerID

Jump to

Keyboard shortcuts

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