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(host string, path string, params URLParams) ([]byte, error)
- type ResponseParams
- type URLParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateResponse ¶ added in v1.5.0
func CreateResponse(msg string, params ResponseParams) []byte
CreateResponse creates a generic HTTP response in JSON format.
func ExtractDomainFromURL ¶ added in v1.5.0
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.
Types ¶
type ResponseParams ¶ added in v1.5.0
type ResponseParams map[string]interface{}
ResponseParams holds parameters of an HTTP response.
Click to show internal directories.
Click to hide internal directories.