Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReverseProxyHandler ¶
type ReverseProxyHandler struct {
jsonapi.URLResolver // The URL resolver.
BaseURL string // The base URL of the JSON:API server.
Client jsonapi.Doer // The HTTP client.
}
ReverseProxyHandler is a handler that forwards client requests to the JSON:API server at the given base URL.
func NewReverseProxyHandler ¶
func NewReverseProxyHandler(baseURL string, options ...func(*ReverseProxyHandler)) ReverseProxyHandler
NewReverseProxyHandler creates a new reverse proxy handler. This handler forwards client requests to the JSON:API server at the given base URL.
By default, NewReverseProxyHandler generates the following urls (given a base url):
":base/:type" for search, create ":base/:type/:id" for fetch, update, delete ":base/:type/:id/relationships/:ref" for fetchRef ":base/:type/:id/:ref" for fetchRelated
This behavior can be modified by updating the URLResolver field of a ReverseProxyHandler instance.
func (ReverseProxyHandler) ServeJSONAPI ¶
func (p ReverseProxyHandler) ServeJSONAPI(r *http.Request) jsonapi.Response
ServeJSONAPI forwards the request to the JSON:API server at the given base URL.
Click to show internal directories.
Click to hide internal directories.