statusfile

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 8 Imported by: 1 module, 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

This section is empty.

Variables

This section is empty.

Functions

func ListStatusFiles

func ListStatusFiles() ([]string, error)

func ListStatusFilesFromConfigDir added in v0.6.0

func ListStatusFilesFromConfigDir(configDir string) ([]string, error)

Types

type CostTracking added in v0.7.0

type CostTracking struct {
	ByTool   map[string]int64 `json:"by_tool"`
	ByServer map[string]int64 `json:"by_server"`
	Total    int64            `json:"total"`
	Enabled  bool             `json:"enabled"`
}

type FileStatusStore

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

func NewFileStatusStore

func NewFileStatusStore(listenAddr string, logger *slog.Logger) (*FileStatusStore, error)

func NewFileStatusStoreFromConfigDir added in v0.6.0

func NewFileStatusStoreFromConfigDir(listenAddr string, logger *slog.Logger, configDir string) (*FileStatusStore, error)

func (*FileStatusStore) GetCostTracking added in v0.7.0

func (s *FileStatusStore) GetCostTracking() *CostTracking

func (*FileStatusStore) GetFilePath

func (s *FileStatusStore) GetFilePath() string

func (*FileStatusStore) RemoveFile

func (s *FileStatusStore) RemoveFile()

func (*FileStatusStore) UpdateCostTracking added in v0.7.0

func (s *FileStatusStore) UpdateCostTracking(costTracking *CostTracking)

func (*FileStatusStore) UpdateServers

func (s *FileStatusStore) UpdateServers(servers []ServerStatus)

type ServerStatus

type ServerStatus struct {
	Name         string    `json:"name"`
	Status       string    `json:"status"`
	RequestCount int64     `json:"request_count"`
	ErrorCount   int64     `json:"error_count"`
	RestartCount int       `json:"restart_count"`
	Uptime       string    `json:"uptime"`
	ToolCount    int       `json:"tool_count"`
	LastActivity time.Time `json:"last_activity"`
}

type StatusInfo

type StatusInfo struct {
	PID          int            `json:"pid"`
	StartedAt    time.Time      `json:"started_at"`
	ListenAddr   string         `json:"listen_addr"`
	Servers      []ServerStatus `json:"servers"`
	CostTracking *CostTracking  `json:"cost_tracking,omitempty"`
}

func ReadCurrentStatus

func ReadCurrentStatus() (*StatusInfo, error)

func ReadCurrentStatusFromConfigDir added in v0.6.0

func ReadCurrentStatusFromConfigDir(configDir string) (*StatusInfo, error)

Jump to

Keyboard shortcuts

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