client

package module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: MIT Imports: 8 Imported by: 2

README

hrobot-go: A Go library for the Hetzner Robot Webservice

Build Coverage

Package hrobot-go is a library for the Hetzner Robot Webservice.

The library’s documentation is available at GoDoc, the public API documentation is available at robot.your-server.de.

Example

package main

import (
    "fmt"
    "log"

    client "github.com/nl2go/hrobot-go"
)

func main() {
    robotClient := client.NewBasicAuthClient("user", "pass")

    servers, err := robotClient.ServerGetList()
    if err != nil {
        log.Fatalf("error while retrieving server list: %s\n", err)
    }

    fmt.Println(servers)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Username string
	Password string
	// contains filtered or unexported fields
}

func (*Client) BootRescueGet

func (c *Client) BootRescueGet(ip string) (*models.Rescue, error)

func (*Client) BootRescueSet

func (c *Client) BootRescueSet(ip string, input *models.RescueSetInput) (*models.Rescue, error)

func (*Client) FailoverGet added in v0.1.3

func (c *Client) FailoverGet(ip string) (*models.Failover, error)

func (*Client) FailoverGetList added in v0.1.3

func (c *Client) FailoverGetList() ([]models.Failover, error)

func (*Client) GetVersion

func (c *Client) GetVersion() string

func (*Client) IPGetList

func (c *Client) IPGetList() ([]models.IP, error)

func (*Client) KeyGetList

func (c *Client) KeyGetList() ([]models.Key, error)

func (*Client) RDnsGet

func (c *Client) RDnsGet(ip string) (*models.Rdns, error)

func (*Client) RDnsGetList

func (c *Client) RDnsGetList() ([]models.Rdns, error)

func (*Client) ResetGet

func (c *Client) ResetGet(ip string) (*models.Reset, error)

func (*Client) ResetSet

func (c *Client) ResetSet(ip string, input *models.ResetSetInput) (*models.ResetPost, error)

func (*Client) ServerGet

func (c *Client) ServerGet(ip string) (*models.Server, error)

func (*Client) ServerGetList

func (c *Client) ServerGetList() ([]models.Server, error)

func (*Client) ServerReverse

func (c *Client) ServerReverse(ip string) (*models.Cancellation, error)

func (*Client) ServerSetName

func (c *Client) ServerSetName(ip string, input *models.ServerSetNameInput) (*models.Server, error)

func (*Client) SetBaseURL

func (c *Client) SetBaseURL(baseURL string)

func (*Client) SetUserAgent

func (c *Client) SetUserAgent(userAgent string)

type RobotClient

type RobotClient interface {
	SetBaseURL(baseURL string)
	SetUserAgent(userAgent string)
	GetVersion() string
	ServerGetList() ([]models.Server, error)
	ServerGet(ip string) (*models.Server, error)
	ServerSetName(ip string, input *models.ServerSetNameInput) (*models.Server, error)
	ServerReverse(ip string) (*models.Cancellation, error)
	KeyGetList() ([]models.Key, error)
	IPGetList() ([]models.IP, error)
	RDnsGetList() ([]models.Rdns, error)
	RDnsGet(ip string) (*models.Rdns, error)
	BootRescueGet(ip string) (*models.Rescue, error)
	BootRescueSet(ip string, input *models.RescueSetInput) (*models.Rescue, error)
	ResetGet(ip string) (*models.Reset, error)
	ResetSet(ip string, input *models.ResetSetInput) (*models.ResetPost, error)
	FailoverGetList() ([]models.Failover, error)
	FailoverGet(ip string) (*models.Failover, error)
}

func NewBasicAuthClient

func NewBasicAuthClient(username, password string) RobotClient

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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