Documentation ¶
Index ¶
- func AbsoluteURL(req *goa.RequestData, relative string, config configuration) string
- func AddParam(urlString string, paramName string, paramValue string) (string, error)
- func AddParams(urlString string, params map[string]string) (string, error)
- func AddTrailingSlashToURL(url string) string
- func CloseResponse(response *http.Response)
- func Host(req *goa.RequestData, config configuration) string
- func ReadBody(body io.ReadCloser) string
- func ReplaceDomainPrefix(host string, replaceBy string) (string, error)
- func ReplaceDomainPrefixInAbsoluteURL(req *goa.RequestData, replaceBy, relative string, config configuration) (string, error)
- func ReplaceDomainPrefixInAbsoluteURLStr(urlStr, replaceBy, relative string) (string, error)
- func ValidateEmail(email string) (bool, error)
- type HTTPClientOption
- type HttpClient
- type HttpClientDoer
- type HttpDoer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbsoluteURL ¶
func AbsoluteURL(req *goa.RequestData, relative string, config configuration) string
AbsoluteURL prefixes a relative URL with absolute address If config is not nil and run in dev mode then host is replaced by "auth.openshift.io"
func AddTrailingSlashToURL ¶
AddTrailingSlashToURL adds a trailing slash to the URL if it doesn't have it already If URL is an empty string the function returns an empty string too
func CloseResponse ¶
CloseResponse reads the body and close the response. To be used to prevent file descriptor leaks.
func Host ¶
func Host(req *goa.RequestData, config configuration) string
Host returns the host from the given request if run in prod mode or if config is nil and "auth.openshift.io" if run in dev mode
func ReadBody ¶
func ReadBody(body io.ReadCloser) string
ReadBody reads body from a ReadCloser and returns it as a string
func ReplaceDomainPrefix ¶
ReplaceDomainPrefix replaces the last name in the host by a new name. Example: api.service.domain.org -> sso.service.domain.org If replaceBy == "" then return trim the last name. Example: api.service.domain.org -> service.domain.org
func ReplaceDomainPrefixInAbsoluteURL ¶
func ReplaceDomainPrefixInAbsoluteURL(req *goa.RequestData, replaceBy, relative string, config configuration) (string, error)
ReplaceDomainPrefixInAbsoluteURL replaces the last name in the host of the URL by a new name. Example: https://api.service.domain.org -> https://sso.service.domain.org If replaceBy == "" then return trim the last name. Example: https://api.service.domain.org -> https://service.domain.org Also prefixes a relative URL with absolute address If config is not nil and run in dev mode then "auth.openshift.io" is used as a host
func ReplaceDomainPrefixInAbsoluteURLStr ¶
ReplaceDomainPrefixInAbsoluteURLStr check ReplaceDomainPrefixInAbsoluteURL. This works on url string.
func ValidateEmail ¶
ValidateEmail return true if the string is a valid email address This is a very simple validation. It just checks if there is @ and dot in the address
Types ¶
type HTTPClientOption ¶
HTTPClientOption options passed to the HTTP Client
func WithRoundTripper ¶
func WithRoundTripper(r http.RoundTripper) HTTPClientOption
WithRoundTripper configures the client's transport with the given round-tripper
type HttpClient ¶
HttpClient defines the Do method of the http client.
type HttpClientDoer ¶
type HttpClientDoer struct {
HttpClient HttpClient
}
HttpClientDoer implements HttpDoer