registry

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryRegistry added in v0.0.3

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

MemoryRegistry is a concurrent in-memory implementation of WorkerRegistry.

func NewMemoryRegistry added in v0.0.3

func NewMemoryRegistry() *MemoryRegistry

func (*MemoryRegistry) Delete added in v0.0.3

func (r *MemoryRegistry) Delete(workerID string)

func (*MemoryRegistry) Get added in v0.0.3

func (r *MemoryRegistry) Get(workerID string) (string, bool)

func (*MemoryRegistry) Set added in v0.0.3

func (r *MemoryRegistry) Set(workerID, addr string)

type RedisRegistry added in v0.0.3

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

RedisRegistry implements WorkerRegistry using simple Redis strings.

Key schema:

{prefix}registry:{workerID}  ->  string "host:port"

Each key has a TTL equal to registryTTL. The health poller refreshes the TTL on every successful check by calling Set again.

func NewRedisRegistry added in v0.0.3

func NewRedisRegistry(client *redisstate.Client, registryTTL time.Duration) *RedisRegistry

func (*RedisRegistry) Delete added in v0.0.3

func (r *RedisRegistry) Delete(workerID string)

func (*RedisRegistry) Get added in v0.0.3

func (r *RedisRegistry) Get(workerID string) (string, bool)

func (*RedisRegistry) Set added in v0.0.3

func (r *RedisRegistry) Set(workerID, addr string)

type WorkerRegistry added in v0.0.3

type WorkerRegistry interface {
	Get(workerID string) (string, bool)
	Set(workerID string, addr string)
	Delete(workerID string)
}

WorkerRegistry defines the contract for worker address lookup. MemoryRegistry is the in-process implementation; Redis implements the same interface for shared state during rolling updates.

Jump to

Keyboard shortcuts

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