Documentation
¶
Index ¶
- func AuthHTTPClient(hostname string) *http.Client
- func CurrentUserID(client *Client, hostname string) (string, error)
- func CurrentUserOrganizationID(client *Client, hostname string) (string, error)
- func CurrentUsername(client *Client, hostname string) (string, error)
- func HandleHTTPError(resp *http.Response) error
- func NewHTTPClient(opts ...ClientOption) *http.Client
- func UnsecureHTTPClient(hostname string) *http.Client
- type Client
- type ClientOption
- type HTTPError
- type Organization
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthHTTPClient ¶
AuthHTTPClient returns an authenticated HTTP client
func CurrentUserOrganizationID ¶
CurrentUserOrganizationID returns the identifier of the default organization for the current logged in user
func HandleHTTPError ¶
func NewHTTPClient ¶
func NewHTTPClient(opts ...ClientOption) *http.Client
NewHTTPClient initializes an http.Client with a default timeout
func UnsecureHTTPClient ¶
UnsecureHTTPClient returns a non-authenticated HTTP client
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client facilitates making HTTP requests to the Reliably API
func NewClientFromHTTP ¶
NewClientFromHTTP takes in an http.Client instance
type ClientOption ¶
type ClientOption = func(http.RoundTripper) http.RoundTripper
ClientOption represents an argument to NewClient
func AddHeader ¶
func AddHeader(name, value string) ClientOption
AddHeader turns a RoundTripper into one that adds a request header
func AddHeaderFunc ¶
AddHeaderFunc is an AddHeader that gets the string value from a function
type Organization ¶
type Organization struct {
ID string `json:"id"`
Name string `json:"name"`
CreatedBy string `json:"created_by"`
}
Organization represents an Organization under Reliably
func CurrentUserOrganization ¶
func CurrentUserOrganization(client *Client, hostname string) (*Organization, error)
CurrentUserOrganization returns the default organization of the current logged in user
func ListOrganizations ¶
func ListOrganizations(client *Client, hostname string) ([]Organization, error)
ListOrganizations list all organizations to which the current logged in user is a member of