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.Schemas) (types.URLBuilder, error)
- func NewPrefixed(r *http.Request, schemas *types.Schemas, prefix string) (types.URLBuilder, error)
- func ParseRequestURL(r *http.Request) string
- func ParseResponseURLBase(currentURL string, r *http.Request) (string, error)
- type DefaultPathResolver
- type DefaultURLBuilder
- func (u *DefaultURLBuilder) Action(schema *types.Schema, id, action string) string
- func (u *DefaultURLBuilder) Collection(schema *types.Schema) string
- func (u *DefaultURLBuilder) CollectionAction(schema *types.Schema, action string) string
- func (u *DefaultURLBuilder) Current() string
- func (u *DefaultURLBuilder) FilterLink(schema *types.Schema, fieldName string, value string) string
- func (u *DefaultURLBuilder) Link(schema *types.Schema, 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.Schema, id string) string
- func (u *DefaultURLBuilder) ReverseSort(order types.SortOrder) string
- func (u *DefaultURLBuilder) Sort(field 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.Schemas) (types.URLBuilder, error)
func NewPrefixed ¶
func ParseRequestURL ¶
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.Schema, id, action string) string
func (*DefaultURLBuilder) Collection ¶
func (u *DefaultURLBuilder) Collection(schema *types.Schema) string
func (*DefaultURLBuilder) CollectionAction ¶
func (u *DefaultURLBuilder) CollectionAction(schema *types.Schema, action string) string
func (*DefaultURLBuilder) Current ¶
func (u *DefaultURLBuilder) Current() string
func (*DefaultURLBuilder) FilterLink ¶
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.Schema, id string) string
func (*DefaultURLBuilder) ReverseSort ¶
func (u *DefaultURLBuilder) ReverseSort(order types.SortOrder) string
func (*DefaultURLBuilder) Sort ¶
func (u *DefaultURLBuilder) Sort(field string) string
Click to show internal directories.
Click to hide internal directories.