Documentation ¶
Index ¶
- Variables
- func Capitalize(word string) string
- func ContainedIn(value string, list []string) bool
- func ContainsSubString(value string, list []string) bool
- func DecodeKeyPairs(list []string) (map[string]string, error)
- func DefaultTo(v, d string) string
- func DialAddress(location *url.URL) string
- func FileExists(filename string) bool
- func FindCookie(name string, cookies []*http.Cookie) *http.Cookie
- func GenerateHmac(req *http.Request, encKey string) (string, error)
- func GetHashKey(token string) string
- func GetRefreshTokenFromCookie(req *http.Request, cookieName string) (string, error)
- func GetRequestHostURL(req *http.Request) string
- func GetTokenInBearer(req *http.Request) (string, error)
- func GetTokenInCookie(req *http.Request, name string) (string, error)
- func GetTokenInHeader(req *http.Request, headerName string) (string, error)
- func GetTokenInRequest(req *http.Request, name string, skipAuthorizationHeaderIdentity bool, ...) (string, bool, error)
- func GetWithin(expires time.Time, within float64) time.Duration
- func HasAccess(need, have []string, all bool) bool
- func IsUpgradedConnection(req *http.Request) bool
- func IsValidHTTPMethod(method string) bool
- func MergeMaps(dest, source map[string]string) map[string]string
- func PrintError(message string, args ...interface{}) cli.ExitCoder
- func RealIP(req *http.Request) string
- func ToHeader(v string) string
- func TransferBytes(src io.Reader, dest io.Writer, wg *sync.WaitGroup) (int64, error)
- func TryDialEndpoint(location *url.URL) (net.Conn, error)
- func TryUpdateConnection(req *http.Request, writer http.ResponseWriter, endpoint *url.URL) error
Constants ¶
This section is empty.
Variables ¶
var ( AllHTTPMethods = []string{ http.MethodDelete, http.MethodGet, http.MethodHead, http.MethodOptions, http.MethodPatch, http.MethodPost, http.MethodPut, http.MethodTrace, } )
Functions ¶
func Capitalize ¶
capitalize capitalizes the first letter of a word
func ContainedIn ¶
containedIn checks if a value in a list of a strings
func ContainsSubString ¶
containsSubString checks if substring exists
func DecodeKeyPairs ¶
decodeKeyPairs converts a list of strings (key=pair) to a map
func DialAddress ¶
dialAddress extracts the dial address from the url
func FindCookie ¶
findCookie looks for a cookie in a list of cookies
func GetHashKey ¶
getHashKey returns a hash of the encodes jwt token
func GetRefreshTokenFromCookie ¶
GetRefreshTokenFromCookie returns the refresh token from the cookie if any
func GetRequestHostURL ¶
getRequestHostURL returns the hostname from the request
func GetTokenInBearer ¶
getTokenInBearer retrieves a access token from the authorization header
func GetTokenInCookie ¶
getTokenInCookie retrieves the access token from the request cookies
func GetTokenInHeader ¶
getTokenInHeader retrieves a token from the header
func GetTokenInRequest ¶
func GetTokenInRequest( req *http.Request, name string, skipAuthorizationHeaderIdentity bool, tokenHeader string, ) (string, bool, error)
getTokenInRequest returns the token from the http request
func GetWithin ¶
getWithin calculates a duration of x percent of the time period, i.e. something expires in 1 hours, get me a duration within 80%
func IsUpgradedConnection ¶
isUpgradedConnection checks to see if the request is requesting
func IsValidHTTPMethod ¶
IsValidHTTPMethod ensure this is a valid http method type
func PrintError ¶
func PrintError(message string, args ...interface{}) cli.ExitCoder
printError display the command line usage and error
func TransferBytes ¶
transferBytes transfers bytes between the sink and source
func TryDialEndpoint ¶
tryDialEndpoint dials the upstream endpoint via plain HTTP
func TryUpdateConnection ¶
tryUpdateConnection attempt to upgrade the connection to a http pdy stream
Types ¶
This section is empty.