Documentation
¶
Index ¶
- type APIError
- type Client
- func (c *Client) Delete(path string) (json.RawMessage, error)
- func (c *Client) Get(path string) (json.RawMessage, error)
- func (c *Client) GraphQL(query string, variables map[string]interface{}) (json.RawMessage, error)
- func (c *Client) Patch(path string, body interface{}) (json.RawMessage, error)
- func (c *Client) Post(path string, body interface{}) (json.RawMessage, error)
- func (c *Client) PostFile(path, field, fileName string, content []byte) (json.RawMessage, error)
- func (c *Client) Put(path string, body interface{}) (json.RawMessage, error)
- type StaticToken
- type TokenSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
BaseURL string
Auth TokenSource
HTTPClient *http.Client
}
func NewClientWithAuth ¶ added in v1.6.0
func NewClientWithAuth(baseURL string, auth TokenSource) *Client
func (*Client) GraphQL ¶ added in v1.8.1
GraphQL runs a query against POST /graphql and returns its "data" object. Metrics and BMC sensors are only served through GraphQL. A GraphQL error comes back as an *APIError; NOT_FOUND maps to 404.
func (*Client) Patch ¶
func (c *Client) Patch(path string, body interface{}) (json.RawMessage, error)
type StaticToken ¶ added in v1.6.0
type StaticToken string
StaticToken is a TokenSource for API tokens, which cannot be refreshed.
func (StaticToken) Token ¶ added in v1.6.0
func (t StaticToken) Token() (string, error)