Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExtServices ¶ added in v0.2.0
ExtServices declares interface to get status of all external services
type ExtServicesMock ¶ added in v0.3.0
type ExtServicesMock struct {
// StatusFunc mocks the Status method.
StatusFunc func() []external.Response
// contains filtered or unexported fields
}
ExtServicesMock is a mock implementation of ExtServices.
func TestSomethingThatUsesExtServices(t *testing.T) {
// make and configure a mocked ExtServices
mockedExtServices := &ExtServicesMock{
StatusFunc: func() []external.Response {
panic("mock out the Status method")
},
}
// use mockedExtServices in code that requires ExtServices
// and then make assertions.
}
func (*ExtServicesMock) Status ¶ added in v0.3.0
func (mock *ExtServicesMock) Status() []external.Response
Status calls StatusFunc.
func (*ExtServicesMock) StatusCalls ¶ added in v0.3.0
func (mock *ExtServicesMock) StatusCalls() []struct { }
StatusCalls gets all the calls that were made to Status. Check the length with:
len(mockedExtServices.StatusCalls())
type Info ¶
type Info struct {
HostName string `json:"hostname"`
Procs int `json:"procs"`
HostID string `json:"host_id"`
CPUPercent int `json:"cpu_percent"`
MemPercent int `json:"mem_percent"`
Uptime uint64 `json:"uptime"`
Volumes map[string]Volume `json:"volumes,omitempty"`
Loads struct {
One float64 `json:"one"`
Five float64 `json:"five"`
Fifteen float64 `json:"fifteen"`
} `json:"load_average"`
ExtServices map[string]external.Response `json:"services,omitempty"`
}
Info contains disk and cpu utilization results
type Service ¶
type Service struct {
Volumes []Volume
ExtServices ExtServices
}
Service provides disk and cpu utilization
Click to show internal directories.
Click to hide internal directories.