mesh

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	ID       string `json:"id"`
	Endpoint string `json:"endpoint"`
	Region   string `json:"region"`
	Status   string `json:"status"`
}

Cluster represents a remote Hermod cluster in the mesh.

type Manager

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

Manager handles inter-cluster routing and mesh topology.

func NewManager

func NewManager(logger hermod.Logger) *Manager

NewManager creates a new mesh Manager.

func (*Manager) Failover

func (m *Manager) Failover(ctx context.Context, from, to string) error

Failover marks a cluster as failed and redirects traffic if possible.

func (*Manager) GetCluster

func (m *Manager) GetCluster(id string) (Cluster, bool)

GetCluster returns a cluster by its ID.

func (*Manager) GetClusters

func (m *Manager) GetClusters() []Cluster

GetClusters returns all registered clusters.

func (*Manager) RegisterCluster

func (m *Manager) RegisterCluster(_ context.Context, c Cluster) error

RegisterCluster adds a new cluster to the mesh.

type MeshClient

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

MeshClient handles HTTP communication with remote clusters.

func (*MeshClient) Forward

func (c *MeshClient) Forward(ctx context.Context, msg hermod.Message) error

Forward sends a message to the remote cluster's receive endpoint.

type MeshManager

type MeshManager interface {
	RegisterCluster(ctx context.Context, c Cluster) error
	GetCluster(id string) (Cluster, bool)
	GetClusters() []Cluster
	Failover(ctx context.Context, fromClusterID, toClusterID string) error
}

MeshManager defines the interface for managing clusters in a mesh.

type MeshSink

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

MeshSink implements hermod.Sink to forward messages to other clusters.

func NewMeshSink

func NewMeshSink(target Cluster) *MeshSink

NewMeshSink creates a new MeshSink.

func (*MeshSink) Close

func (s *MeshSink) Close() error

Close closes any resources used by the MeshSink.

func (*MeshSink) Ping

func (s *MeshSink) Ping(ctx context.Context) error

Ping checks the health of the target cluster.

func (*MeshSink) Write

func (s *MeshSink) Write(ctx context.Context, msg hermod.Message) error

Write forwards the message to the target cluster.

Jump to

Keyboard shortcuts

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