info

package
v0.0.0-...-b371d68 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ORDER_SORT     = 1
	ORDER_CPU      = 2
	ORDER_CAPACITY = 3
)
View Source
const CHECKTIME = 10 * time.Second
View Source
const STABLETIME = 30 * time.Second

Variables

This section is empty.

Functions

func LoadJson

func LoadJson(file string, dat interface{}) error

func SaveJson

func SaveJson(file string, dat interface{}) error

Types

type Net

type Net struct {
	Dom  string
	Addr string
}

type SD

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

func NewServerInfo

func NewServerInfo(file string) (*SD, error)

func (*SD) GetServers

func (sd *SD) GetServers(sys, env string, nofar bool) []*Server

func (*SD) GetServersOrdered

func (sd *SD) GetServersOrdered(sys, env string, nofar bool, orderby int) []*Server

type Server

type Server struct {
	Subsystem      string
	Environment    string
	Hostname       string
	Datacenter     string
	Rack           string
	Id             string
	IsUp           bool
	IsLocal        bool
	Uptodate       bool
	SortMetric     int32
	CpuMetric      int32
	CapacityMetric int32
	TimeLastUp     uint64
	TimeUpSince    uint64
	Database       []string
	NetInfo        []Net
}

func LoadServerInfo

func LoadServerInfo(file string) ([]*Server, error)

func (*Server) BestAddr

func (s *Server) BestAddr() string

Jump to

Keyboard shortcuts

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