Documentation ¶
Overview ¶
Get information on the web api supported on this instance.
Index ¶
- func CheckResponse(r *http.Response) error
- func Do(c *http.Client, req *http.Request, v interface{}) error
- func NewRequest(method, path string, baseURL *url.URL, username, password string, ...) (*http.Request, error)
- func SetBaseURLUtil(urlStr string) (*url.URL, error)
- type Client
- type ErrorResponse
- type ExampleFetcher
- type WebservicesListOption
- type WebservicesListResp
- type WebservicesResponseExampleOption
- type WebservicesResponseExampleResp
- type WebservicesService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckResponse ¶
func Do ¶
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it.
func NewRequest ¶
func NewRequest(method, path string, baseURL *url.URL, username, password string, opt interface{}) (*http.Request, error)
NewRequest creates an API request. A relative URL path can be provided in urlStr, in which case it is resolved relative to the base URL of the Client. Relative URL paths should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.
Types ¶
type Client ¶
type Client struct { Webservices *WebservicesService // contains filtered or unexported fields }
func (*Client) Do ¶
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it.
func (*Client) NewRequest ¶
NewRequest creates an API request. A relative URL path can be provided in urlStr, in which case it is resolved relative to the base URL of the Client. Relative URL paths should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.
func (*Client) SetBaseURL ¶
SetBaseURL sets the base URL for API requests to a custom endpoint. urlStr should always be specified with a trailing slash.
type ErrorResponse ¶
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
type ExampleFetcher ¶
type ExampleFetcher struct {
// contains filtered or unexported fields
}
func NewExampleFetcher ¶
func NewExampleFetcher(endpoint, username, password string) *ExampleFetcher
func (*ExampleFetcher) GetResponseExample ¶
func (e *ExampleFetcher) GetResponseExample(service *api.WebService) (examples []*WebservicesResponseExampleResp, err error)
type WebservicesListOption ¶
type WebservicesListOption struct {
IncludeInternals string `url:"include_internals,omitempty"` // Description:"Include web services that are implemented for internal use only. Their forward-compatibility is not assured",ExampleValue:""
}
type WebservicesListResp ¶
type WebservicesListResp struct{}
[TODO] you should call the <List> func manually and complete the fields of this struct
type WebservicesResponseExampleResp ¶
type WebservicesResponseExampleResp struct { Format string `json:"format,omitempty"` Example string `json:"example,omitempty"` Name string `json:"name,omitempty"` }
[TODO] you should call the <ResponseExample> func manually and complete the fields of this struct
type WebservicesService ¶
type WebservicesService struct {
// contains filtered or unexported fields
}
func (*WebservicesService) List ¶
func (s *WebservicesService) List(opt *WebservicesListOption) (Resp *WebservicesListResp, err error)
List List web services
func (*WebservicesService) ResponseExample ¶
func (s *WebservicesService) ResponseExample(opt *WebservicesResponseExampleOption) (resp *WebservicesResponseExampleResp, err error)
Response_example Display web service response example