gotransip: github.com/transip/gotransip Index | Files | Directories

package gotransip

import "github.com/transip/gotransip"

Index

Package Files

api.go client.go sign.go soap.go

type APIMode Uses

type APIMode string

APIMode specifies in which mode the API is used. Currently this is only supports either readonly or readwrite

var (
    // APIModeReadOnly specifies that no changes can be made from API calls
    APIModeReadOnly APIMode = "readonly"
    // APIModeReadWrite specifies that changes can be made from API calls
    APIModeReadWrite APIMode = "readwrite"
)

type CancellationTime Uses

type CancellationTime string

CancellationTime represents the possible ways of canceling a contract

var (
    // CancellationTimeEnd specifies to cancel the contract when the contract was
    // due to end anyway
    CancellationTimeEnd CancellationTime = "end"
    // CancellationTimeImmediately specifies to cancel the contract immediately
    CancellationTimeImmediately CancellationTime = "immediately"
)

type Client Uses

type Client interface {
    Call(SoapRequest, interface{}) error // execute request on client
}

Client is the interface which all clients should implement

type ClientConfig Uses

type ClientConfig struct {
    AccountName    string
    PrivateKeyPath string
    PrivateKeyBody []byte
    Mode           APIMode
}

ClientConfig is a tool to easily create a new Client object

type FakeSOAPClient Uses

type FakeSOAPClient struct {
    // contains filtered or unexported fields
}

FakeSOAPClient is a client doing nothing except implementing the gotransip.Client interface you can however set a fixture XML body which Call will try to Unmarshal into result useful for testing

func (FakeSOAPClient) Call Uses

func (f FakeSOAPClient) Call(req SoapRequest, result interface{}) error

Call doesn't do anything except fill the XML unmarshalled result

func (*FakeSOAPClient) FixtureFromFile Uses

func (f *FakeSOAPClient) FixtureFromFile(file string) (err error)

FixtureFromFile reads file and sets content as FakeSOAPClient's fixture

type ParamsContainer Uses

type ParamsContainer interface {
    Len() int
    Add(string, interface{})
}

ParamsContainer is the interface a type should implement to be able to hold SOAP parameters

type SOAPClient Uses

type SOAPClient struct {
    // contains filtered or unexported fields
}

SOAPClient represents a TransIP API SOAP client, implementing the Client interface

func NewSOAPClient Uses

func NewSOAPClient(c ClientConfig) (SOAPClient, error)

NewSOAPClient returns a new SOAPClient object for given config ClientConfig's PrivateKeyPath will override potentially given PrivateKeyBody

func (SOAPClient) Call Uses

func (c SOAPClient) Call(req SoapRequest, result interface{}) error

Call performs given SOAP request and fills the response into result

type SoapRequest Uses

type SoapRequest struct {
    Service string
    Method  string

    Padding []string
    // contains filtered or unexported fields
}

SoapRequest holds all information for perfoming a SOAP request Arguments to the request can be specified with AddArgument If padding is defined, the SOAP response will be parsed after it being padded with items in Padding in reverse order

func (*SoapRequest) AddArgument Uses

func (sr *SoapRequest) AddArgument(key string, value interface{})

AddArgument adds an argument to the SoapRequest; the arguments ared used to fill the XML request body as well as to create a valid signature for the request

type TestParamsContainer Uses

type TestParamsContainer struct {
    Prm string
}

TestParamsContainer is only useful for unit testing the ParamsContainer implementation of other type

func (*TestParamsContainer) Add Uses

func (t *TestParamsContainer) Add(key string, value interface{})

Add just makes sure we use Len(), key and value in the result so it can be tested

func (TestParamsContainer) Len Uses

func (t TestParamsContainer) Len() int

Len returns current length of test data in TestParamsContainer

Directories

PathSynopsis
colo
domain
haip
util
vps
webhosting

Package gotransip imports 20 packages (graph) and is imported by 6 packages. Updated 2018-09-26. Refresh now. Tools for package owners.