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 ¶
- Variables
- func ControllerCheckin(id ControllerID) error
- func DeregisterController(id ControllerID) error
- func InitializeActiveControllerRegistry(njs *events.NatsJetstream) error
- func InitializeRegistryWithOptions(njs *events.NatsJetstream, opts ...kv.Option) error
- func LastContact(id ControllerID) (time.Time, error)
- func RegisterController(id ControllerID) error
- type ControllerID
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 ¶
func ControllerIDFromString ¶ added in v0.6.1
func ControllerIDFromString(s string) (ControllerID, error)
func GetID ¶
func GetID(app string) ControllerID
Click to show internal directories.
Click to hide internal directories.