Documentation ¶
Overview ¶
Package manifold implements the Go language bindings for the Manifold 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 ¶
const ( APIPrefix = "/manifold-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 manifold-api service. )
Variables ¶
This section is empty.
Functions ¶
func WithDebug ¶
WithDebug is an option setting function for NewClient that sets the debug mode on the underlying generic http client.
func WithLogger ¶
WithLogger is an option setting function for NewClient that sets the logger on the underlying generic http client.
func WithUserAgent ¶
WithUserAgent is an option setting function for NewClient that sets the user-agent on the underlying generic http client.
Types ¶
type Client ¶
type Client struct { Cloud *cloud.Service Metal *metal.Service Upload *upload.Service Snapshot *snapshot.Service *client.Client }
Client is a connection to the manifold-api service.
type InfoResponse ¶
type InfoResponse struct { ProductName string `json:"product_name"` ProductRelease string `json:"product_release"` }
InfoResponse is the response body for GET /.
type ResponseError ¶
type ResponseError struct { Code int `json:"code"` Text string `json:"error"` Details []string `json:"details"` }
ResponseError is the response body for all error responses.
func NewErrorResponse ¶
func NewErrorResponse(code int, err error, detail ...string) *ResponseError
NewErrorResponse returns a new ErrorResponse.
func (ResponseError) Error ¶
func (e ResponseError) Error() string
Error implements the error interface for e.
func (ResponseError) StatusCode ¶
func (e ResponseError) StatusCode() int
StatusCode returns the status code for e.