registry

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectCommand

func DetectCommand(command string) (string, error)

func ParseCommandLine

func ParseCommandLine(input string) (string, []string)

Types

type BackendHandle

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

func (*BackendHandle) Close

func (bh *BackendHandle) Close() error

func (*BackendHandle) Forward

func (bh *BackendHandle) Forward(req *protocol.Request) (*protocol.Response, error)

func (*BackendHandle) HealthCheck

func (bh *BackendHandle) HealthCheck()

func (*BackendHandle) IsHealthy

func (bh *BackendHandle) IsHealthy() bool

func (*BackendHandle) Name

func (bh *BackendHandle) Name() string

func (*BackendHandle) Tools

func (bh *BackendHandle) Tools() ([]protocol.ToolDefinition, error)

type BackendMetadata

type BackendMetadata struct {
	Name      string    `json:"name"`
	Type      string    `json:"type"`
	Healthy   bool      `json:"healthy"`
	ToolCount int       `json:"toolCount"`
	StartedAt time.Time `json:"startedAt"`
	ErrCount  int       `json:"errorCount"`
}

type DiscoveredManifest

type DiscoveredManifest struct {
	Source     string   `json:"source"`
	ServerCmd  string   `json:"serverCmd"`
	ServerArgs []string `json:"serverArgs"`
}

func DiscoverFromConfig

func DiscoverFromConfig(_ string) (*DiscoveredManifest, error)

func ParseManifest

func ParseManifest(data []byte) (*DiscoveredManifest, error)

type HealthChecker

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

func NewHealthChecker

func NewHealthChecker(interval, timeout time.Duration, maxFailures int) *HealthChecker

func (*HealthChecker) HealthyBackends

func (hc *HealthChecker) HealthyBackends(backends []*BackendHandle) []*BackendHandle

func (*HealthChecker) Reset

func (hc *HealthChecker) Reset(name string)

func (*HealthChecker) Start

func (hc *HealthChecker) Start(ctx context.Context, backends []*BackendHandle)

func (*HealthChecker) Status

func (hc *HealthChecker) Status(name string) (int, bool)

type Registry

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

func NewRegistry

func NewRegistry(cfg *config.Config) *Registry

func (*Registry) AddBackend

func (r *Registry) AddBackend(ctx context.Context, cfg config.BackendConfig) error

func (*Registry) AggregatedTools

func (r *Registry) AggregatedTools() []protocol.ToolDefinition

func (*Registry) All

func (r *Registry) All() []*BackendHandle

func (*Registry) BackendCount

func (r *Registry) BackendCount() int

func (*Registry) Get

func (r *Registry) Get(name string) *BackendHandle

func (*Registry) HealthCheckAll

func (r *Registry) HealthCheckAll()

func (*Registry) HealthCheckAndRestart

func (r *Registry) HealthCheckAndRestart()

func (*Registry) InitBackends

func (r *Registry) InitBackends(ctx context.Context) error

func (*Registry) Metadata

func (r *Registry) Metadata() []BackendMetadata

func (*Registry) Reload

func (r *Registry) Reload(cfg *config.Config) error

func (*Registry) Remove

func (r *Registry) Remove(name string)

func (*Registry) SetBaseContext

func (r *Registry) SetBaseContext(ctx context.Context)

func (*Registry) StartAll

func (r *Registry) StartAll(ctx context.Context) error

func (*Registry) StopAll

func (r *Registry) StopAll() error

Jump to

Keyboard shortcuts

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