Documentation ¶
Index ¶
- Constants
- func ConstructBasicURL(parts ...string) string
- func GetHost(r *http.Request, scheme string) string
- func GetScheme(r *http.Request) string
- func New(r *http.Request, resolver PathResolver, schemas *types.APISchemas) (types.URLBuilder, error)
- func NewPrefixed(r *http.Request, schemas *types.APISchemas, prefix string) (types.URLBuilder, error)
- func ParseRequestURL(r *http.Request) string
- func ParseResponseURLBase(currentURL string, r *http.Request) (string, error)
- func RedirectRewrite(next http.Handler) http.Handler
- type DefaultPathResolver
- type DefaultURLBuilder
- func (u *DefaultURLBuilder) Action(schema *types.APISchema, id, action string) string
- func (u *DefaultURLBuilder) Collection(schema *types.APISchema) string
- func (u *DefaultURLBuilder) CollectionAction(schema *types.APISchema, action string) string
- func (u *DefaultURLBuilder) Current() string
- func (u *DefaultURLBuilder) Link(schema *types.APISchema, id string, linkName string) string
- func (u *DefaultURLBuilder) Marker(marker string) string
- func (u *DefaultURLBuilder) RelativeToRoot(path string) string
- func (u *DefaultURLBuilder) ResourceLink(schema *types.APISchema, id string) string
- type PathResolver
Constants ¶
View Source
const ( PrefixHeader = "X-API-URL-Prefix" ForwardedAPIHostHeader = "X-API-Host" ForwardedHostHeader = "X-Forwarded-Host" ForwardedProtoHeader = "X-Forwarded-Proto" ForwardedPortHeader = "X-Forwarded-Port" )
Variables ¶
This section is empty.
Functions ¶
func ConstructBasicURL ¶
func New ¶
func New(r *http.Request, resolver PathResolver, schemas *types.APISchemas) (types.URLBuilder, error)
func NewPrefixed ¶
func NewPrefixed(r *http.Request, schemas *types.APISchemas, prefix string) (types.URLBuilder, error)
func ParseRequestURL ¶
func ParseResponseURLBase ¶
Types ¶
type DefaultPathResolver ¶
type DefaultPathResolver struct {
Prefix string
}
type DefaultURLBuilder ¶
type DefaultURLBuilder struct {
// contains filtered or unexported fields
}
func (*DefaultURLBuilder) Action ¶
func (u *DefaultURLBuilder) Action(schema *types.APISchema, id, action string) string
func (*DefaultURLBuilder) Collection ¶
func (u *DefaultURLBuilder) Collection(schema *types.APISchema) string
func (*DefaultURLBuilder) CollectionAction ¶
func (u *DefaultURLBuilder) CollectionAction(schema *types.APISchema, action string) string
func (*DefaultURLBuilder) Current ¶
func (u *DefaultURLBuilder) Current() string
func (*DefaultURLBuilder) Marker ¶
func (u *DefaultURLBuilder) Marker(marker string) string
func (*DefaultURLBuilder) RelativeToRoot ¶
func (u *DefaultURLBuilder) RelativeToRoot(path string) string
func (*DefaultURLBuilder) ResourceLink ¶
func (u *DefaultURLBuilder) ResourceLink(schema *types.APISchema, id string) string
Click to show internal directories.
Click to hide internal directories.