Documentation
¶
Index ¶
Constants ¶
View Source
const ( MimeJSON = "application/json" MimeHTML = "text/html; charset=utf-8" EncodingGzip = "gzip" )
Mime types.
View Source
const ( DefaultTimeout = 2 * time.Minute DefaultIdempotencyTTL = 5 * time.Minute )
Timeouts.
View Source
const ( AccessControlAllowMethodsKey = "Access-Control-Allow-Methods" AccessControlAllowHeadersKey = "Access-Control-Allow-Headers" AccessControlAllowOriginKey = "Access-Control-Allow-Origin" AccessControlRequestHeaders = "Access-Control-Request-Headers" Origin = "Origin" CFConnectingIPKey = "CF-Connecting-IP" AllowedOriginsKey = "ALLOWED_ORIGINS" XForwardedForKey = "X-Forwarded-For" XRealIPKey = "X-Real-IP" SubpathKey = "subpath" AllowKey = "Allow" )
Variables ¶
View Source
var ( HeaderAuthorization = http.CanonicalHeaderKey("authorization") HeaderContentType = http.CanonicalHeaderKey("content-type") HeaderContentLength = http.CanonicalHeaderKey("content-length") HeaderContentEncoding = http.CanonicalHeaderKey("content-encoding") HeaderContentDisposition = http.CanonicalHeaderKey("content-disposition") HeaderAcceptEncoding = http.CanonicalHeaderKey("accept-encoding") HeaderXForwardedProto = http.CanonicalHeaderKey("x-forwarded-proto") HeaderXForwardedFor = http.CanonicalHeaderKey("x-forwarded-for") HeaderUserAgent = http.CanonicalHeaderKey("user-agent") )
Headers (Canonicalized for Proper Casing).
View Source
var ( PrefixBearer = http.CanonicalHeaderKey("bearer") PrefixMod = http.CanonicalHeaderKey("mod") )
Authentication prefixes.
View Source
var ( EnvKeyAddress = envKey("address") EnvKeyEnvironment = envKey("environment") EnvKeyMongoCluster = envKey("mongo_cluster") EnvKeyMongoConnStr = envKey("mongo_conn_str") EnvKeyRedisHost = envKey("redis_host") EnvKeyRedisPort = envKey("redis_port") EnvKeyMongoConnStrDev = envKey("mongo_conn_str_dev") EnvKeyMongoConnStrStaging = envKey("mongo_conn_str_staging") EnvKeyMongoConnStrProd = envKey("mongo_conn_str_prod") EnvKeyMongoClusterDev = envKey("mongo_cluster_dev") EnvKeyMongoClusterStaging = envKey("mongo_cluster_staging") EnvKeyMongoClusterProd = envKey("mongo_cluster_prod") EnvKeyRedisHostDev = envKey("redis_host_dev") EnvKeyRedisHostStaging = envKey("redis_host_staging") EnvKeyRedisHostProd = envKey("redis_host_prod") EnvKeyRedisPortDev = envKey("redis_port_dev") EnvKeyRedisPortStaging = envKey("redis_port_staging") EnvKeyRedisPortProd = envKey("redis_port_prod") )
View Source
var ( MsgAuthentication = msg("authentication successful") MsgInsertOne = msg("record created successfully") MsgFindOne = msg("record retrieved successfully") MsgFindMany = msg("records retrieved successfully") MsgReplaceOne = msg("record updated successfully") MsgDeleteOne = msg("record deleted successfully") MsgDeleteMany = msg("records deleted successfully") MsgSearchMany = msg("records found successfully") MsgNotFound = msg("not found") )
View Source
var IPHeaders = []string{XForwardedForKey, XRealIPKey, CFConnectingIPKey}
Functions ¶
This section is empty.
Types ¶
type Vars ¶ added in v0.1.10
Vars holds extracted path and query parameters.
func (*Vars) GetPath ¶ added in v0.1.32
GetPath returns the value of a path param or an error if not found or empty.
Click to show internal directories.
Click to hide internal directories.