Documentation ¶
Overview ¶
Package client provides the interfaces to communicate with the API of Hivelocity. Creating interfaces makes unit testing via mocking possible.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoSuchDevice = errors.New("no such device")
ErrNoSuchDevice means that no device was found via the Hivelocity API.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements the Interface interface.
func (*Client) GetBareMetalDevice ¶
func (c *Client) GetBareMetalDevice( ctx context.Context, deviceID int32, ) (*hv.BareMetalDevice, error)
GetBareMetalDevice returns the device fetched via the Hivelocity API.
func (*Client) ListDevices ¶
ListDevices lists all devices via Hivelocity API.
type Interface ¶
type Interface interface { GetBareMetalDevice(ctx context.Context, deviceID int32) (*hv.BareMetalDevice, error) ListDevices(context.Context) ([]hv.BareMetalDevice, error) }
Interface is a wrapper of hv.APIClient. In this way, mocking (for tests) is easier.
type LoggingTransport ¶
type LoggingTransport struct {
// contains filtered or unexported fields
}
LoggingTransport is a struct for creating new logger for Hivelocity API.
Click to show internal directories.
Click to hide internal directories.