Documentation ¶
Index ¶
- Constants
- Variables
- type URLHelper
- func (uh URLHelper) Current() string
- func (uh URLHelper) Join(pathname string) string
- func (uh URLHelper) JoinWithQuery(pathname string, query url.Values) string
- func (uh URLHelper) Path(pathname string) string
- func (uh URLHelper) PathWithQuery(pathname string, query url.Values) string
- func (uh URLHelper) SchemePlusHost() string
Constants ¶
View Source
const ( // XForwardedHost header for host forwarding XForwardedHost = "X-Forwarded-Host" // XForwardedProtocol header for http protocol forwarding XForwardedProtocol = "X-Forwarded-Proto" // XForwardedPathPrefix header for path prefix eg. Path is appended to beging of url generating urls XForwardedPathPrefix = "X-Forwarded-Path-Prefix" )
Variables ¶
View Source
var EnablePathPrefix = false
EnablePathPrefix is a flag to enable path prefix for entire module
Functions ¶
This section is empty.
Types ¶
type URLHelper ¶
type URLHelper struct {
// contains filtered or unexported fields
}
URLHelper struct to keep internal state of the request object
func NewURLHelper ¶
NewURLHelper creates a new URLHelper from the http.Request
func (URLHelper) Current ¶
Current retuns the current url with X-Forwarded-Host and X-Forwarded-Proto
func (URLHelper) Join ¶
Join returns the absolute of the request joined with the inputed path segment. Keeps query params.
func (URLHelper) JoinWithQuery ¶
func (URLHelper) Path ¶
Path returns the absolute of the request reset to the inputed path segment. Removes all query params.
func (URLHelper) PathWithQuery ¶
PathWithQuery returns the absolute of the request reset to the inputed path segment and uses the inputed query params.
func (URLHelper) SchemePlusHost ¶
SchemePlusHost returns the Scheme concatenated with the host but no path
Click to show internal directories.
Click to hide internal directories.