sifi

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package sifi implements the go language bindings for the HyperCloud SIFI API. The bindings will support exactly one version of the API at a time, even though the data types for all currently supported versions can be found in the v* directories.

Index

Constants

View Source
const (
	APIPrefix   = "/hypercloud-api" // APIPrefix is the prefix for all API paths.
	APIVersion  = "v3-preview"      // APIVersion is the prefix for all API paths (without the leading slash).
	PortNumber  = 7434              // PortNumber is the default port for `sifid` (sifi on a keypad).
	ServiceName = "sifid"           // ServiceName is the public name of the SIFI service.
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Cloud    *cloud.Service
	Metal    *metal.Service
	Snapshot *snapshot.Service

	*client.Client
}

Client is a connection to the SIFI service.

func NewClient

func NewClient(o *client.Options) *Client

NewClient returns a new client.

type ResponseError added in v0.16.0

type ResponseError struct {
	Code   int      `json:"code"`
	Text   string   `json:"error"`
	Detail []string `json:"detail"`
}

ResponseError is the response body for all error responses.

func NewErrorResponse added in v0.16.0

func NewErrorResponse(code int, err error, detail ...string) *ResponseError

NewErrorResponse returns a new ErrorResponse.

func (ResponseError) Error added in v0.16.0

func (e ResponseError) Error() string

Error implements the error interface for e.

func (ResponseError) StatusCode added in v0.16.0

func (e ResponseError) StatusCode() int

StatusCode returns the status code for e.

Jump to

Keyboard shortcuts

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