liquidweb

package module
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

README

Usage

uesrname := "blars"
password := "tacoman"
url := "https://api.stormondemand.com"

api := storm.NewAPI(username, password, url)

// Get storm servers
api.StormServer.List()

// Create a storm server
stormServerParams := &storm.StormServerParams{
  configID: 123,
  hostname: "blars.tacoman.com"
  zoneID: 123,
  password: "123",
  publicKey: "yourkey"
}
stormServer, err := api.StormServer.Create(stormServerParams)
if err != nil {
  fmt.Errorf("Error creating storm server %v", err)
}
fmt.Println(stormServer.UniqID)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Call(string, interface{}, interface{}) error
	CallRaw(string, interface{}) ([]byte, error)
}

Backend is an interface for calls against Liquid Web's API.

type LWAPIError

type LWAPIError struct {
	ErrorMsg     string `json:"error,omitempty"`
	ErrorClass   string `json:"error_class,omitempty"`
	ErrorFullMsg string `json:"full_message,omitempty"`
}

A LWAPIError is used to identify error responses when JSON unmarshalling json from a byte slice.

func (LWAPIError) Error

func (e LWAPIError) Error() string

Given a LWAPIError, returns a string containing the ErrorClass and ErrorFullMsg.

func (LWAPIError) HasError

func (e LWAPIError) HasError() bool

HasError returns boolean if ErrorClass was present or not. You can use this function to determine if a LWAPIRes response indicates an error or not.

type LWAPIRes

type LWAPIRes interface {
	Error() string
	HasError() bool
}

LWAPIRes is a convenient interface used (for example) by Call to ensure a passed struct knows how to indicate whether or not it had an error.

type ListMeta

type ListMeta struct {
	ItemCount types.FlexInt `json:"item_count,omitempty"`
	ItemTotal types.FlexInt `json:"item_total,omitempty"`
	PageNum   types.FlexInt `json:"page_num,omitempty"`
	PageSize  types.FlexInt `json:"page_size,omitempty"`
	PageTotal types.FlexInt `json:"page_total,omitempty"`
}

ListMeta handles Liquid Web's pagination in HTTP responses.

type PageParams

type PageParams struct {
	PageNum  types.FlexInt `json:"page_num,omitempty"`
	PageSize types.FlexInt `json:"page_size,omitempty"`
}

PageParams support pagination parameters in parameter types.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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