model

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateDown = "down"
	StateUp   = "up"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Discovery

type Discovery interface {
	Register(ctx context.Context, hostname string, updCb func(Node) error, meta map[string]string) error
	Deregister(ctx context.Context) error
	GetNodes(ctx context.Context) ([]Node, error)
}

type KVPair

type KVPair[V any] struct {
	Key      string
	Value    V
	Modified time.Time
}

func LastTsMerge

func LastTsMerge[V any](a, b KVPair[V]) KVPair[V]

type KeyNotFoundError

type KeyNotFoundError struct {
	Key string
}

func (KeyNotFoundError) Error

func (err KeyNotFoundError) Error() string

type KvTooOldError

type KvTooOldError struct {
	Key         string
	InsertingTs time.Time
	InRepoTs    time.Time
}

func (KvTooOldError) Error

func (err KvTooOldError) Error() string

type MergeFunc

type MergeFunc[V any] func(a, b KVPair[V]) KVPair[V]

func (MergeFunc[V]) Merge

func (mf MergeFunc[V]) Merge(a, b KVPair[V]) KVPair[V]

type Merger

type Merger[V any] interface {
	Merge(a, b KVPair[V]) KVPair[V]
}

type MetricsProvider

type MetricsProvider interface {
	Metrics() []prometheus.Collector
}

type Node

type Node struct {
	ID          string
	Hostname    string
	ServiceName string
	State       string
	Meta        map[string]string
}

Jump to

Keyboard shortcuts

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