Versions in this module Expand all Collapse all v0 v0.1.0 Aug 25, 2018 Changes in this version + func CheckResponse(r *http.Response) error + func DoRequest(ctx context.Context, req *http.Request) (*http.Response, error) + func DoRequestWithClient(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) + type Client struct + BaseURL *url.URL + Order OrderService + Server ServerService + UserAgent string + func New(username, password string, httpClient *http.Client, opts ...ClientOpt) (*Client, error) + func NewClient(username, password string, httpClient *http.Client) *Client + func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Response, error) + func (c *Client) NewRequest(ctx context.Context, method, urlStr string, body interface{}) (*http.Request, error) + func (c *Client) OnRequestCompleted(rc RequestCompletionCallback) + type ClientOpt func(*Client) error + func SetBaseURL(bu string) ClientOpt + func SetUserAgent(ua string) ClientOpt + type ErrorResponse struct + Code string + Message string + Response *http.Response + Status int + func (r *ErrorResponse) Error() string + type OrderService interface + ListServerMarketProducts func(context.Context, *ProductSearchRequest) ([]Product, *Response, error) + type OrderServiceOp struct + func (s *OrderServiceOp) ListServerMarketProducts(ctx context.Context, opt *ProductSearchRequest) ([]Product, *Response, error) + type Product struct + Arch []int + CPU string + CPUBenchmark int + Datacenter string + Description []string + Dist []string + FixedPrice bool + HddCount int + HddSize int + HddText string + ID int + Lang []string + MemorySize int + Name string + NetworkSpeed string + NextReduce int + NextReduceDate string + Price string + PriceSetup string + PriceSetupVat string + PriceVat string + Traffic string + type ProductSearchRequest struct + CPU string + MaxCPUBenchmark string + MaxHDDCount string + MaxHDDSize string + MaxMemorySize string + MaxPrice string + MinCPUBenchmark string + MinHDDCount string + MinHDDSize string + MinMemorySize string + MinPrice string + Search string + type RequestCompletionCallback func(*http.Request, *http.Response) + type Response struct + type Server struct + Cancelled bool + Dc string + Flatrate bool + PaidUntil string + Product string + ServerIP string + ServerName string + ServerNumber int + Status string + Throttled bool + Traffic string + type ServerService interface + ListServers func(context.Context) ([]Server, *Response, error) + type ServerServiceOp struct + func (s *ServerServiceOp) ListServers(ctx context.Context) ([]Server, *Response, error)