config

package
v0.1.984 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2026 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Index

Constants

View Source
const (
	MimeJSON        = "application/json"
	MimeOctetStream = "application/octet-stream"
	MimeMultipart   = "multipart/form-data"
	MimeHTML        = "text/html; charset=utf-8"
	EncodingGzip    = "gzip"
	MimePrefixImage = "image"
	MimePrefixVideo = "video"
	MimePrefixAudio = "audio"
	MimePrefixOther = "other"
)

Mime types.

View Source
const (
	DefaultTimeout        = 2 * time.Minute
	DefaultTimeoutMedium  = 15 * time.Minute
	DefaultTimeoutLong    = time.Hour
	DefaultTimeoutShort   = 1 * 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"
	SubpathKey                   = "subpath"
	AllowKey                     = "Allow"
	HTTPSScheme                  = "https"
	HTTPScheme                   = "http"
)

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")
	HeaderXRealIP            = http.CanonicalHeaderKey("x-real-ip")
	HeaderXTwilioSignature   = http.CanonicalHeaderKey("x-twilio-signature")
	HeaderStripeSignature    = http.CanonicalHeaderKey("stripe-signature")
)

Headers (Canonicalized for Proper Casing).

View Source
var (
	PrefixBearer = http.CanonicalHeaderKey("bearer")
	PrefixMod    = http.CanonicalHeaderKey("mod")
)

Authentication prefixes.

View Source
var (
	DummyURL             = dummyURL("url")
	DummyAPIKey          = dummy("api-key")
	DummyStr             = dummy("dummy")
	DummyBytes           = dummyBytes(DummyStr)
	DummyJSON            = dummyBytes(`{}`)
	DummyCredentialsJSON = dummyBytes(`{"type":"service_account","client_email":"noop@noop.invalid","private_key":"-----BEGIN PRIVATE KEY-----\nnoop\n-----END PRIVATE KEY-----\n"}`)
)
View Source
var (
	EnvKeyAddress             = envKey("address")
	EnvKeyProject             = envKey("project")
	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")
	MsgUpsertOne      = msg("record upserted successfully")
	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")
	MsgPull           = msg("pull operation successful")
	MsgNotFound       = msg("not found")
)

Functions

This section is empty.

Types

type Dummy added in v0.1.861

type Dummy = string

type EnvKey added in v0.1.105

type EnvKey = string

type Message

type Message = string

type QVals added in v0.1.61

type QVals []string

func (QVals) String added in v0.1.61

func (q QVals) String() string

type Vars added in v0.1.10

type Vars struct {
	Svc       string
	Ressource string
	Path      map[string]string
	Query     map[string][]string
}

Vars holds extracted path and query parameters.

func (*Vars) AppendQuery added in v0.1.451

func (v *Vars) AppendQuery(key string, values ...string)

AppendQuery adds values to an existing query param without replacing it. WARN: appends values; understand the implications in a loop — can cause unintended accumulation.

func (*Vars) AppendQueryMap added in v0.1.453

func (v *Vars) AppendQueryMap(params map[string][]string)

AppendQueryMap appends all values from the provided map into the Vars query map without overwriting existing values. WARN: appends values; understand the implications in a loop — can cause unintended accumulation.

func (*Vars) CanonicalQuerySHA256 added in v0.1.660

func (v *Vars) CanonicalQuerySHA256(exclude ...string) string

CanonicalQuerySHA256 returns a hex digest of CanonicalRawQuery.

func (*Vars) CanonicalRawQuery added in v0.1.660

func (v *Vars) CanonicalRawQuery(exclude ...string) string

CanonicalRawQuery returns a stable query string built from v.Query: - keys sorted lexicographically - values for each key sorted - url-escaped key/value pairs If exclude contains keys, they are omitted.

func (*Vars) GetPath added in v0.1.32

func (v *Vars) GetPath(key string) (string, error)

GetPath returns the value of a path param or an error if not found or empty.

func (*Vars) GetQuery added in v0.1.32

func (v *Vars) GetQuery(key string, errOnEmpty bool) (QVals, error)

GetQuery returns the values of a query param.

func (*Vars) GetQueryFirst added in v0.1.32

func (v *Vars) GetQueryFirst(key string, errOnEmpty bool) (string, error)

GetQueryFirst returns the first value of a query param.

func (*Vars) ReplaceQuery added in v0.1.474

func (v *Vars) ReplaceQuery(key string, values ...string)

ReplaceQuery sets the query key to the given values, replacing any existing ones.

func (*Vars) ReplaceQueryMap added in v0.1.475

func (v *Vars) ReplaceQueryMap(params map[string][]string)

ReplaceQueryMap sets the query key to the given values, replacing any existing ones.

type VarsKey added in v0.1.10

type VarsKey struct{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL