Documentation ¶
Index ¶
- func CreateFileRequestBody(path, contentType string, params map[string]string) (*bytes.Buffer, string, error)
- func ToH(z interface{}) map[string]interface{}
- type Bridge
- func (b Bridge) BuildDataRequest(method, url string, data map[string]interface{}) *http.Request
- func (b *Bridge) Delete(url string, modifiers ...RequestModifier) *ParsedResponse
- func (b *Bridge) FormatRequest(r *http.Request) string
- func (b *Bridge) Get(url string, modifiers ...RequestModifier) *ParsedResponse
- func (b *Bridge) Patch(url string, data map[string]interface{}, modifiers ...RequestModifier) *ParsedResponse
- func (b *Bridge) PlayRequest(r *http.Request) *ParsedResponse
- func (b *Bridge) Post(url string, data map[string]interface{}, modifiers ...RequestModifier) *ParsedResponse
- func (b *Bridge) Put(url string, data map[string]interface{}, modifiers ...RequestModifier) *ParsedResponse
- func (b *Bridge) ToH(z interface{}) map[string]interface{}
- func (b *Bridge) Upload(url string, filename string, contentType string, modifiers ...RequestModifier) (*ParsedResponse, error)
- func (b *Bridge) UploadWithParameters(url string, filename string, contentType string, params map[string]string, ...) (*ParsedResponse, error)
- type Connection
- type H
- type ParsedResponse
- type RequestModifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bridge ¶
type Bridge struct { Client http.Client Connection *Connection Verbose bool }
func (Bridge) BuildDataRequest ¶
BuildDataRequest creates a request
func (*Bridge) Delete ¶
func (b *Bridge) Delete(url string, modifiers ...RequestModifier) *ParsedResponse
Delete creates, sends a DELETE request and fetches the response
func (*Bridge) FormatRequest ¶
FormatRequest pretty-formats a request and returns it as a string
func (*Bridge) Get ¶
func (b *Bridge) Get(url string, modifiers ...RequestModifier) *ParsedResponse
Get creates, sends a GET request and fetches the response
func (*Bridge) Patch ¶
func (b *Bridge) Patch(url string, data map[string]interface{}, modifiers ...RequestModifier) *ParsedResponse
Patch creates, sends a PATCH request and fetches the response
func (*Bridge) PlayRequest ¶
func (b *Bridge) PlayRequest(r *http.Request) *ParsedResponse
PlayRequest will send the request to the router and fetch the response
func (*Bridge) Post ¶
func (b *Bridge) Post(url string, data map[string]interface{}, modifiers ...RequestModifier) *ParsedResponse
Post creates, sends a POST request and fetches the response
func (*Bridge) Put ¶
func (b *Bridge) Put(url string, data map[string]interface{}, modifiers ...RequestModifier) *ParsedResponse
Put creates, sends a PUT request and fetches the response
func (*Bridge) Upload ¶
func (b *Bridge) Upload(url string, filename string, contentType string, modifiers ...RequestModifier) (*ParsedResponse, error)
func (*Bridge) UploadWithParameters ¶
func (b *Bridge) UploadWithParameters(url string, filename string, contentType string, params map[string]string, modifiers ...RequestModifier) (*ParsedResponse, error)
type Connection ¶
type Connection struct { Email string URL string Credentials app.AuthResponse }
func NewConnection ¶
func NewConnection() Connection
func (*Connection) Modify ¶
func (c *Connection) Modify(r *http.Request)
func (*Connection) RequireCredentials ¶
func (c *Connection) RequireCredentials()
func (*Connection) RequireEmail ¶
func (c *Connection) RequireEmail()
func (*Connection) RequireURL ¶
func (c *Connection) RequireURL()
type ParsedResponse ¶
func (*ParsedResponse) Close ¶
func (pr *ParsedResponse) Close()
func (*ParsedResponse) DecodeJSON ¶
func (pr *ParsedResponse) DecodeJSON(target interface{}) error
func (*ParsedResponse) OK ¶
func (pr *ParsedResponse) OK() bool
func (*ParsedResponse) Plain ¶
func (pr *ParsedResponse) Plain() string
func (*ParsedResponse) PrintCode ¶
func (pr *ParsedResponse) PrintCode()
type RequestModifier ¶
Click to show internal directories.
Click to hide internal directories.