Documentation
¶
Overview ¶
Package client provides a generic client to be used by all services
Index ¶
- type Client
- func (c *Client) Delete(path string, extraHeader ...interface{}) (*gohttp.Response, error)
- func (c *Client) DeleteWithBody(path string, data interface{}, extraHeader ...interface{}) (*gohttp.Response, error)
- func (c *Client) DeleteWithResp(path string, respV interface{}, extraHeader ...interface{}) (*gohttp.Response, error)
- func (c *Client) Get(path string, respV interface{}, extraHeader ...interface{}) (*gohttp.Response, error)
- func (c *Client) GetPaginated(path string, paginated PaginatedResourcesHandler, cb func(interface{}) bool) (resp *gohttp.Response, err error)
- func (c *Client) MakeRequest(r *rest.Request, respV interface{}) (*gohttp.Response, error)
- func (c *Client) Patch(path string, data interface{}, respV interface{}, extraHeader ...interface{}) (*gohttp.Response, error)
- func (c *Client) Post(path string, data interface{}, respV interface{}, extraHeader ...interface{}) (*gohttp.Response, error)
- func (c *Client) PostWithForm(path string, form interface{}, respV interface{}, extraHeader ...interface{}) (*gohttp.Response, error)
- func (c *Client) Put(path string, data interface{}, respV interface{}, extraHeader ...interface{}) (*gohttp.Response, error)
- func (c *Client) SendRequest(r *rest.Request, respV interface{}) (*gohttp.Response, error)
- func (c *Client) URL(path string) string
- type Config
- type PaginatedResourcesHandler
- type TokenProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Config *bluemix.Config
DefaultHeader gohttp.Header
ServiceName bluemix.ServiceName
TokenRefresher TokenProvider
// contains filtered or unexported fields
}
Client is the base client for all service api client
func New ¶
func New(c *bluemix.Config, serviceName bluemix.ServiceName, refresher TokenProvider) *Client
New ...
func (*Client) DeleteWithBody ¶
func (c *Client) DeleteWithBody(path string, data interface{}, extraHeader ...interface{}) (*gohttp.Response, error)
DeleteWithBody ...
func (*Client) DeleteWithResp ¶
func (c *Client) DeleteWithResp(path string, respV interface{}, extraHeader ...interface{}) (*gohttp.Response, error)
DeleteWithResp ...
func (*Client) Get ¶
func (c *Client) Get(path string, respV interface{}, extraHeader ...interface{}) (*gohttp.Response, error)
Get ...
func (*Client) GetPaginated ¶
func (*Client) MakeRequest ¶
MakeRequest ...
func (*Client) Patch ¶
func (c *Client) Patch(path string, data interface{}, respV interface{}, extraHeader ...interface{}) (*gohttp.Response, error)
Patch ...
func (*Client) Post ¶
func (c *Client) Post(path string, data interface{}, respV interface{}, extraHeader ...interface{}) (*gohttp.Response, error)
Post ...
func (*Client) PostWithForm ¶
func (c *Client) PostWithForm(path string, form interface{}, respV interface{}, extraHeader ...interface{}) (*gohttp.Response, error)
PostWithForm ...
func (*Client) Put ¶
func (c *Client) Put(path string, data interface{}, respV interface{}, extraHeader ...interface{}) (*gohttp.Response, error)
Put ...
func (*Client) SendRequest ¶
SendRequest ...
type TokenProvider ¶
type TokenProvider interface {
RefreshToken() (string, error)
GetPasscode() (string, error)
AuthenticatePassword(string, string) error
AuthenticateAPIKey(string) error
AuthenticateAssume(string, string) error
GetKubeTokens() (string, string, error)
FetchAuthorizationData(core.Authenticator) error
}
TokenProvider ...
Click to show internal directories.
Click to hide internal directories.