{"modulePath":"github.com/mycontroller-org/server/v2","version":"v2.2.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package http_handler\n\n## Functions\n\n```go\nfunc EntityNameToKind(entityName string) string\n```\nEntityNameToKind maps a storage entity name to a policy kind.\n\n```go\nfunc ExtractHost(hostport string) string\n```\nExtractHost splits a host / port pair (or just a host) and returns the host. This is large borrowed from \\`net/url.splitHostPort\\`.\n\n```go\nfunc FindMany(storage storageTY.Plugin, w http.ResponseWriter, r *http.Request, entityName string, entities interface{})\n```\nFindMany func\n\n```go\nfunc FindOne(storage storageTY.Plugin, w http.ResponseWriter, r *http.Request, entityName string, entity interface{})\n```\nFindOne func\n\n```go\nfunc GetParameter(key string, parameters map[string][]string) string\n```\nGetParameter returns a first value or empty\n\n```go\nfunc GetParameters(key string, parameters map[string][]string) []string\n```\nGetParameters returns all values or empty slice\n\n```go\nfunc LoadData(w http.ResponseWriter, r *http.Request, entityFn func(f []storageTY.Filter, p *storageTY.Pagination) (interface{}, error))\n```\nLoadData loads data\n\n```go\nfunc LoadEntity(w http.ResponseWriter, r *http.Request, entity interface{}) error\n```\nLoadEntity func\n\n```go\nfunc Params(request *http.Request) ([]storageTY.Filter, *storageTY.Pagination, error)\n```\nParams func\n\n```go\nfunc PostErrorResponse(w http.ResponseWriter, message string, code int)\n```\n\n```go\nfunc PostSuccessResponse(w http.ResponseWriter, data interface{})\n```\n\n```go\nfunc ReceivedQueryMap(request *http.Request) (map[string][]string, error)\n```\nReceivedQueryMap returns all the user query and url input\n\n```go\nfunc SaveEntity(storage storageTY.Plugin, w http.ResponseWriter, r *http.Request, entityName string, entity interface{}, bwFunc func(entity interface{}, filters *[]storageTY.Filter) error)\n```\nSaveEntity func\n\n```go\nfunc SetListQueryScope(fn ListQueryScope)\n```\nSetListQueryScope registers RBAC list scoping at query level (call at server HTTP init).\n\n```go\nfunc UpdateData(w http.ResponseWriter, r *http.Request, entity interface{}, updateFn func(f []storageTY.Filter, p *storageTY.Pagination, d []byte) (interface{}, error))\n```\nUpdateData loads data\n\n```go\nfunc WriteResponse(w http.ResponseWriter, data []byte)\n```\n\n## Types\n\n```go\ntype ListQueryScope func(r *http.Request, kind string) (filters []storageTY.Filter, err error)\n```\nListQueryScope returns extra storage filters to AND into list queries (RBAC resource scope). Wired from HTTP setup once access control is ready.\n\n","path":"github.com/mycontroller-org/server/v2/pkg/utils/http_handler","name":"http_handler","synopsis":"","isRedistributable":true}
