# Functions

CheckPermissions checks whether user with a provided token(from request) can access current organization and handled the error on negative result by logging the error and writing a corresponding http response.
CreateOpenAPIHandler creates a handler for a server to send OpenAPI file.
FilterOutDebugMethods returns the same openapi spec, but without endpoints tagged as debug.
GetRouterParam retrieves parameter from URL like `/organization/{org_id}`.
GetRouterPositiveIntParam retrieves parameter from URL like `/organization/{org_id}` and check it for being valid and positive integer, otherwise returns error.
HandleOrgIDError logs org id error and writes corresponding http response.
LogRequest - middleware for logging requests.
MakeURLToEndpoint creates URL to endpoint, use constants from file endpoints.go.
MakeURLToEndpointMap creates URL to endpoint using arguments in map, use constants from file endpoints.go.
MakeURLToEndpointMapString creates URL to endpoint using arguments in map in string format, use constants from file endpoints.go.
ReadAndTrimRuleSelector retrieves the rule selector (rule_id|error_key) from request's url or writes an error to writer.
ReadClusterListFromBody retrieves list of clusters from request's body if it's not possible, it writes http error to the writer and returns false.
ReadClusterListFromPath retrieves list of clusters from request's path if it's not possible, it writes http error to the writer and returns false.
ReadClusterName retrieves cluster name from request if it's not possible, it writes http error to the writer and returns false.
ReadClusterNames does the same as `readClusterName`, except for multiple clusters.
ReadErrorKey retrieves error key from request's url or writes an error to writer.
ReadOrganizationID retrieves organization id from request if it's not possible, it writes http error to the writer and returns false.
ReadOrganizationIDs does the same as `readOrganizationID`, except for multiple organizations.
ReadRuleID retrieves rule id from request's url or writes an error to writer.
ReadRuleSelector retrieves the rule selector (rule_id|error_key) from request's url or writes an error to writer.
ReplaceParamsInEndpointAndTrimLeftSlash replaces params in endpoint and trims left slash.
SendRequest sends the given request, reads the body and handles related errors.
SetHTTPPrefix adds HTTP prefix if it is not already present in the given string.
SplitRequestParamArray takes a single HTTP request parameter and splits it into a slice of strings.
ValidateClusterName checks that the cluster name is a valid UUID.

# Variables

RuleIDValidator points to a Regexp expression that matches any string that has alphanumeric characters separated by at least one dot (".").
RuleSelectorValidator points to a Regexp expression that matches any string that has alphanumeric characters separated by at least one dot (".") before a vertical line ("|"), followed by only characters, numbers, or underscores ("_").