Versions in this module Expand all Collapse all v0 v0.0.1 Apr 5, 2020 Changes in this version + const DefaultTimeout + const KimsufiCA + const KimsufiEU + const OvhCA + const OvhEU + const OvhUS + const RunaboveCA + const SoyoustartCA + const SoyoustartEU + var Endpoints = map[string]string + var ErrAPIDown = errors.New("go-vh: the OVH API is down, it does't respond to /time anymore") + var ReadOnly = []string + var ReadWrite = []string + var ReadWriteSafe = []string + type APIError struct + Code int + Message string + QueryID string + func (err *APIError) Error() string + type AccessRule struct + Method string + Path string + type CkRequest struct + AccessRules []AccessRule + Redirection string + func (ck *CkRequest) AddRecursiveRules(methods []string, path string) + func (ck *CkRequest) AddRule(method, path string) + func (ck *CkRequest) AddRules(methods []string, path string) + func (ck *CkRequest) Do() (*CkValidationState, error) + type CkValidationState struct + ConsumerKey string + State string + ValidationURL string + func (ck *CkValidationState) String() string + type Client struct + AppKey string + AppSecret string + Client *http.Client + ConsumerKey string + Logger Logger + Timeout time.Duration + func NewClient(endpoint, appKey, appSecret, consumerKey string) (*Client, error) + func NewDefaultClient() (*Client, error) + func NewEndpointClient(endpoint string) (*Client, error) + func (c *Client) CallAPI(method, path string, reqBody, resType interface{}, needAuth bool) error + func (c *Client) CallAPIWithContext(ctx context.Context, method, path string, reqBody, resType interface{}, ...) error + func (c *Client) Delete(url string, resType interface{}) error + func (c *Client) DeleteUnAuth(url string, resType interface{}) error + func (c *Client) DeleteUnAuthWithContext(ctx context.Context, url string, resType interface{}) error + func (c *Client) DeleteWithContext(ctx context.Context, url string, resType interface{}) error + func (c *Client) Do(req *http.Request) (*http.Response, error) + func (c *Client) Get(url string, resType interface{}) error + func (c *Client) GetUnAuth(url string, resType interface{}) error + func (c *Client) GetUnAuthWithContext(ctx context.Context, url string, resType interface{}) error + func (c *Client) GetWithContext(ctx context.Context, url string, resType interface{}) error + func (c *Client) NewCkRequest() *CkRequest + func (c *Client) NewCkRequestWithRedirection(redirection string) *CkRequest + func (c *Client) NewRequest(method, path string, reqBody interface{}, needAuth bool) (*http.Request, error) + func (c *Client) Ping() error + func (c *Client) Post(url string, reqBody, resType interface{}) error + func (c *Client) PostUnAuth(url string, reqBody, resType interface{}) error + func (c *Client) PostUnAuthWithContext(ctx context.Context, url string, reqBody, resType interface{}) error + func (c *Client) PostWithContext(ctx context.Context, url string, reqBody, resType interface{}) error + func (c *Client) Put(url string, reqBody, resType interface{}) error + func (c *Client) PutUnAuth(url string, reqBody, resType interface{}) error + func (c *Client) PutUnAuthWithContext(ctx context.Context, url string, reqBody, resType interface{}) error + func (c *Client) PutWithContext(ctx context.Context, url string, reqBody, resType interface{}) error + func (c *Client) Time() (*time.Time, error) + func (c *Client) TimeDelta() (time.Duration, error) + func (c *Client) UnmarshalResponse(response *http.Response, resType interface{}) error + type Logger interface + LogRequest func(*http.Request) + LogResponse func(*http.Response)