Documentation ¶
Index ¶
Constants ¶
const (
// SSHKeyURL defines the SSH key API endpoint.
SSHKeyURL = "https://robot-ws.your-server.de/key"
)
const (
// ServerURL defines the server API endpoint.
ServerURL = "https://robot-ws.your-server.de/server"
)
const (
// StorageboxURL defines the storagebox API endpoint.
StorageboxURL = "https://robot-ws.your-server.de/storagebox"
)
Variables ¶
var ( // UserAgent defines the used user ganet for request. UserAgent = fmt.Sprintf("hetzner_export/%s", version.String) )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Server ServerClient SSHKey SSHKeyClient Storagebox StorageboxClient // contains filtered or unexported fields }
Client is a client for the DockerHub API.
type ClientOption ¶
type ClientOption func(*Client)
A ClientOption is used to configure a Client.
func WithHTTPClient ¶
func WithHTTPClient(value *http.Client) ClientOption
WithHTTPClient configures a Client to use the specified HTTP client.
func WithHTTPDumper ¶
func WithHTTPDumper(value Dumper) ClientOption
WithHTTPDumper configures a Client to use the specified debug dumper.
func WithPassword ¶
func WithPassword(value string) ClientOption
WithPassword configures a Client to use the specified password for authentication.
func WithUsername ¶
func WithUsername(value string) ClientOption
WithUsername configures a Client to use the specified username for authentication.
type Dumper ¶
Dumper dumps the http.Request and http.Response message payload for debugging.
func StandardDumper ¶
StandardDumper returns a standard dumper.
type SSHKeyClient ¶
type SSHKeyClient struct {
// contains filtered or unexported fields
}
SSHKeyClient is a client for the SSH keys API.
type Server ¶
type Server struct { Number string Name string Type string Datacenter string Status float64 Traffic float64 Flatrate float64 Cancelled float64 Paid float64 }
Server represents a server record prepared for the exporter.
type ServerClient ¶
type ServerClient struct {
// contains filtered or unexported fields
}
ServerClient is a client for the servers API.
type Storagebox ¶
type Storagebox struct { Number string Name string Type string Location string Login string Cancelled float64 Locked float64 Paid float64 Quota float64 Usage float64 Data float64 Snapshots float64 Webdav float64 ZFS float64 Samba float64 SSH float64 External float64 }
Storagebox represents a storagebox record prepared for the exporter.
type StorageboxClient ¶
type StorageboxClient struct {
// contains filtered or unexported fields
}
StorageboxClient is a client for the storageboxes API.
func (*StorageboxClient) All ¶
func (c *StorageboxClient) All(ctx context.Context) ([]*Storagebox, error)
All fetches all available storageboxes from API.
func (*StorageboxClient) Get ¶
func (c *StorageboxClient) Get(ctx context.Context, number string) (*Storagebox, error)
Get fetches a specific storagebox from API.