{"modulePath":"github.com/gonobo/jsonapi-reverse-proxy","version":"v0.0.0-20240611155519-d41b86b0dff9","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package proxy\n\n## Types\n\n```go\ntype ReverseProxyHandler struct {\n\tjsonapi.URLResolver              // The URL resolver.\n\tBaseURL             string       // The base URL of the JSON:API server.\n\tClient              jsonapi.Doer // The HTTP client.\n}\n```\nReverseProxyHandler is a handler that forwards client requests to the JSON:API server at the given base URL.\n\n```go\nfunc NewReverseProxyHandler(baseURL string, options ...func(*ReverseProxyHandler)) ReverseProxyHandler\n```\nNewReverseProxyHandler creates a new reverse proxy handler. This handler forwards client requests to the JSON:API server at the given base URL.\n\nBy default, NewReverseProxyHandler generates the following urls (given a base url):\n\n\t\":base/:type\" for search, create\n\t\":base/:type/:id\" for fetch, update, delete\n\t\":base/:type/:id/relationships/:ref\" for fetchRef\n\t\":base/:type/:id/:ref\" for fetchRelated\n\nThis behavior can be modified by updating the URLResolver field of a ReverseProxyHandler instance.\n\n```go\nfunc (p ReverseProxyHandler) ServeJSONAPI(r *http.Request) jsonapi.Response\n```\nServeJSONAPI forwards the request to the JSON:API server at the given base URL.\n\n","path":"github.com/gonobo/jsonapi-reverse-proxy","name":"proxy","synopsis":"","isRedistributable":true}
