heartcore

package
v0.0.0-...-0dcfd8c Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptySQL         = errors.New("sql query cannot be empty")
	ErrNoNodesAvailable = errors.New("no nodes available for routing")
	ErrNilResponse      = errors.New("received nil response from node")
	ErrNilArgument      = errors.New("argument cannot be nil")
	ErrUnsupportedType  = errors.New("unsupported argument type")
)

Functions

This section is empty.

Types

type EnhancedNode

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

type HeartCore

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

func NewHeartCore

func NewHeartCore(
	logger *logger.Logger,
	cfg *config.HeartConfig,
	producer *producer.Producer,
) (*HeartCore, error)

func (*HeartCore) GetHealthyNodeCount

func (h *HeartCore) GetHealthyNodeCount() int

GetHealthyNodeCount returns the number of currently healthy nodes

func (*HeartCore) GetNodeStats

func (h *HeartCore) GetNodeStats() map[string]interface{}

GetNodeStats returns statistics about all nodes

func (*HeartCore) RouteReadRequest

func (h *HeartCore) RouteReadRequest(ctx context.Context, sql string, args ...any) ([]map[string]interface{}, error)

func (*HeartCore) RouteWriteRequest

func (h *HeartCore) RouteWriteRequest(ctx context.Context, sql string, args ...any) error

func (*HeartCore) Start

func (h *HeartCore) Start(ctx context.Context)

Start starts the health checker

func (*HeartCore) Stop

func (h *HeartCore) Stop() error

Stop stops the heart core and all node clients

Jump to

Keyboard shortcuts

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