Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIMode ¶
type APIMode string
APIMode specifies in which mode the API is used. Currently this is only supports either readonly or readwrite
type CancellationTime ¶
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 ¶
type Client interface {
Call(SoapRequest, interface{}) error // execute request on client
}
Client is the interface which all clients should implement
type ClientConfig ¶
type ClientConfig struct { AccountName string PrivateKeyPath string PrivateKeyBody []byte Mode APIMode }
ClientConfig is a tool to easily create a new Client object
type FakeSOAPClient ¶
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 ¶
func (f FakeSOAPClient) Call(req SoapRequest, result interface{}) error
Call doesn't do anything except fill the XML unmarshalled result
func (*FakeSOAPClient) FixtureFromFile ¶
func (f *FakeSOAPClient) FixtureFromFile(file string) (err error)
FixtureFromFile reads file and sets content as FakeSOAPClient's fixture
type ParamsContainer ¶
ParamsContainer is the interface a type should implement to be able to hold SOAP parameters
type SOAPClient ¶
type SOAPClient struct {
// contains filtered or unexported fields
}
SOAPClient represents a TransIP API SOAP client, implementing the Client interface
func NewSOAPClient ¶
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 ¶
func (c SOAPClient) Call(req SoapRequest, result interface{}) error
Call performs given SOAP request and fills the response into result
type SoapRequest ¶
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 ¶
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 ¶
type TestParamsContainer struct {
Prm string
}
TestParamsContainer is only useful for unit testing the ParamsContainer implementation of other type
func (*TestParamsContainer) Add ¶
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 ¶
func (t TestParamsContainer) Len() int
Len returns current length of test data in TestParamsContainer