ha

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package ha provides high-availability (HA) execution patterns.

It supports cache-based HA executors that can register and execute operations with periodic callbacks for health checking and recovery.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor[T any] interface {
	Register(ctxt context.Context, kind Kind, interval time.Duration, cb func(v ...T) *national.Message) (*time.Ticker,
		*national.Message)
	Exec(ctxt context.Context, kind Kind, va ...T) *national.Message
}

func New

func New[T any](ctxt context.Context, props *Properties) (Executor[T], *national.Message)

type Kind

type Kind string

type Properties

type Properties struct {
	Type  Type             `yaml:"type" default:"redis"`
	Cache cache.Properties `yaml:"cache"`
}

type Type

type Type string
const (
	Cache Type = "cache"
)

Jump to

Keyboard shortcuts

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