Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HostDare ¶
type HostDare struct {
// contains filtered or unexported fields
}
func NewHostDare ¶
func (*HostDare) ListServers ¶
func (hd *HostDare) ListServers() (*ListServersResponse, error)
不支持分页。
func (*HostDare) Stats ¶
func (hd *HostDare) Stats(vpsID int) (*StatsServerResponse, error)
https://vps.hostdare.com/sessXXX/index.php?api=json&act=vpsmanage&stats=1&svs=43546
type HostDareExporter ¶
type HostDareExporter struct {
// contains filtered or unexported fields
}
func NewHostDareExporter ¶
func NewHostDareExporter(hd *HostDare) *HostDareExporter
func (*HostDareExporter) Collect ¶
func (hde *HostDareExporter) Collect(w chan<- prometheus.Metric)
func (*HostDareExporter) Describe ¶
func (hde *HostDareExporter) Describe(w chan<- *prometheus.Desc)
type IntAsString ¶
type IntAsString int64
buggy: bits not standard compliant, but most time works well.
func (IntAsString) MarshalJSON ¶
func (i IntAsString) MarshalJSON() ([]byte, error)
func (*IntAsString) UnmarshalJSON ¶
func (i *IntAsString) UnmarshalJSON(b []byte) error
type ListServersResponse ¶
type ListServersResponse struct { Counts struct { VPS IntAsString `json:"vps"` } `json:"counts"` Status map[int]Status `json:"status"` Servers map[int]struct { ID IntAsString `json:"vpsid"` HostName string `json:"hostname"` } `json:"vs"` }
type LoginResponse ¶
type LoginResponse struct {
Redirect string `json:"redirect"`
}
type StatsServerResponse ¶
type StatsServerResponse struct { Info struct { ID IntAsString `json:"vpsid"` Bandwidth struct { Limit float64 `json:"limit"` Used float64 `json:"used"` // Free float64 `json:"free"` Usage map[int]float64 `json:"usage"` In map[int]float64 `json:"in"` Out map[int]float64 `json:"out"` } `json:"bandwidth"` } `json:"info"` }
Click to show internal directories.
Click to hide internal directories.