Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddArguments ¶
AddArguments Adds url arguments to a string with special notation
Types ¶
type API ¶
type API struct { BaseURL string Endpoints map[string]*Endpoint DefaultHandlers *CallbackRouter Client *Client }
func (*API) AddEndpoint ¶
type AuthToken ¶
func NewAuthToken ¶
type Authentication ¶
type Authentication interface {
// contains filtered or unexported methods
}
type BasicAuth ¶
func NewBasicAuth ¶
type CallbackRouter ¶
type CallbackRouter struct { Handlers map[int]HandlerFunc DefaultHandler HandlerFunc }
func NewCallbackRouter ¶
func NewCallbackRouter() *CallbackRouter
func (*CallbackRouter) Handle ¶
func (c *CallbackRouter) Handle(r *http.Response, content interface{}) error
Handle handles a response for an specific status code
func (*CallbackRouter) RegisterHandler ¶
func (c *CallbackRouter) RegisterHandler(status int, f HandlerFunc)
RegisterHandler registers a new handler
type Client ¶
type Client struct { Client *http.Client Authentication Authentication }
func (*Client) SetAuth ¶
func (c *Client) SetAuth(auth Authentication)
SetAuth sets authentication info
type Endpoint ¶
type Endpoint struct { Path string Method string Handler *CallbackRouter }
func NewEndpoint ¶
func NewEndpoint(path string, method string, callback *CallbackRouter) *Endpoint
NewEndpoint Creates a new endpoint with given arguments
type HandlerFunc ¶
Click to show internal directories.
Click to hide internal directories.