state

package
v0.9.5-dev.2 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: GPL-3.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	HealthOK       = "ok"
	HealthDegraded = "degraded"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandMeta

type CommandMeta struct {
	ID         string
	Source     string
	IfRevision *uint64
}

type CommittedError added in v0.9.2

type CommittedError struct {
	Err error
}

CommittedError marks a mutation whose snapshot must be stored even though the caller receives Err.

func (CommittedError) Error added in v0.9.2

func (e CommittedError) Error() string

func (CommittedError) Unwrap added in v0.9.2

func (e CommittedError) Unwrap() error

type ConfigState

type ConfigState struct {
	Status           string
	DesiredRevision  uint64
	ObservedRevision uint64
	LastError        string
}

type Coordinator

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

func NewCoordinator

func NewCoordinator(store *Store) *Coordinator

func (*Coordinator) Do

func (c *Coordinator) Do(ctx context.Context, meta CommandMeta, mutate Mutation) (Snapshot, error)

type CoreState

type CoreState struct {
	Status      string
	Version     string
	Channel     string
	AlphaSHA    string
	PID         int
	Restarts    uint64
	LastError   string
	NextRetryAt time.Time
}

type Mutation

type Mutation func(Snapshot) (Snapshot, error)

type Snapshot

type Snapshot struct {
	Revision           uint64
	Version            string
	StartedAt          time.Time
	Health             string
	LastError          string
	Core               CoreState
	Config             ConfigState
	ActiveSubscription string
	Subscriptions      []SubscriptionState
}

type Store

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

func NewStore

func NewStore(initial Snapshot) *Store

func (*Store) Load

func (s *Store) Load() Snapshot

func (*Store) Store

func (s *Store) Store(next Snapshot)

type SubscriptionState

type SubscriptionState struct {
	ID          string
	Name        string
	Enabled     bool
	AutoRefresh bool
	Interval    string
	Cached      bool
	Generation  uint64
	UpdatedAt   time.Time
	LastError   string
}

Jump to

Keyboard shortcuts

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