Documentation ¶
Index ¶
- func CreateResponse(msg string, params ResponseParams) []byte
- func ExtractDomainFromURL(hostURL *url.URL, keepSubdomain bool) string
- func GenerateURL(host string, path string, params URLParams) (*url.URL, error)
- func ReadEndpoint(endpointURL *url.URL, auth *BasicAuth, checkStatus bool) ([]byte, error)
- func WriteEndpoint(endpointURL *url.URL, auth *BasicAuth, checkStatus bool) ([]byte, error)
- type BasicAuth
- type ResponseParams
- type URLParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateResponse ¶
func CreateResponse(msg string, params ResponseParams) []byte
CreateResponse creates a generic HTTP response in JSON format.
func ExtractDomainFromURL ¶
ExtractDomainFromURL extracts the domain name (domain.tld or subdomain.domain.tld) from a URL.
func GenerateURL ¶
GenerateURL creates a URL object from a host, path and optional parameters.
func ReadEndpoint ¶
ReadEndpoint reads data from an HTTP endpoint via GET.
Types ¶
type ResponseParams ¶
type ResponseParams map[string]interface{}
ResponseParams holds parameters of an HTTP response.
Click to show internal directories.
Click to hide internal directories.