Documentation ¶
Index ¶
- func ContainsInvalidChars(charset, s string) error
- func ContainsValidCharset(charset, s string) error
- func GetBaseURL(r *http.Request, s string) (string, string)
- func GetContentType(r *http.Request) string
- func GetCurrentBaseURL(r *http.Request) string
- func GetCurrentURL(r *http.Request) string
- func GetRandomEncodedStringFromRange(a, b int) string
- func GetRandomString(i int) string
- func GetRandomStringFromRange(a, b int) string
- func GetRandomStringFromRangeWithCharset(a, b int, cs string) string
- func GetRelativeURL(r *http.Request, orig, repl string) string
- func GetRequestID(r *http.Request) string
- func GetSourceAddress(r *http.Request) string
- func NewLogger() *zap.Logger
- func ParseCredentials(r *http.Request) (map[string]string, error)
- func ReadCertFile(filePath string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsInvalidChars ¶ added in v1.0.16
ContainsInvalidChars returns error if the provided string contains characters outside of the allowed character set.
func ContainsValidCharset ¶ added in v1.0.16
ContainsValidCharset returns error if the provided string contains characters outside of the provided character set.
func GetBaseURL ¶ added in v1.4.7
GetBaseURL returns base path based on some match.
func GetContentType ¶ added in v1.2.4
GetContentType returns requested content type.
func GetCurrentBaseURL ¶ added in v1.1.5
GetCurrentBaseURL returns current base URL.
func GetCurrentURL ¶ added in v1.1.5
GetCurrentURL returns current URL.
func GetRandomEncodedStringFromRange ¶ added in v1.3.4
GetRandomEncodedStringFromRange return the number returned by GetRandomStringFromRange() and encoded with Base32
func GetRandomString ¶
GetRandomString returns X character long random string.
func GetRandomStringFromRange ¶
GetRandomStringFromRange generates random string of a random length. The random lenght is bounded by a and b.
func GetRandomStringFromRangeWithCharset ¶ added in v1.4.3
GetRandomStringFromRangeWithCharset generates random string of a random length. The random lenght is bounded by a and b. The charset is provided.
func GetRelativeURL ¶ added in v1.4.7
GetRelativeURL returns relative path to current URL.
func GetRequestID ¶ added in v1.4.7
GetRequestID returns request ID.
func GetSourceAddress ¶ added in v1.2.4
GetSourceAddress returns the IP address of the request.
func ParseCredentials ¶ added in v1.2.4
ParseCredentials extracts credentials from HTTP request.
func ReadCertFile ¶ added in v1.1.3
ReadCertFile return certificate content as a string.
Types ¶
This section is empty.