config

package
v0.1.104 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2025 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

View Source
const (
	MimeJSON     = "application/json"
	MimeHTML     = "text/html; charset=utf-8"
	EncodingGzip = "gzip"
)

Mime types.

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"
)
View Source
const (
	DefaultTimeout = 5 * time.Second
)

Outbound operations timeouts.

View Source
const (
	PrefixCalling = "🧮"
)

Logging prefixes.

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")
)

Headers (Canonicalized for Proper Casing).

View Source
var (
	MsgAuthentication = title("authentication successful")
	MsgInsertOne      = title("record created successfully")
	MsgFindOne        = title("record retrieved successfully")
	MsgFindMany       = title("records retrieved successfully")
	MsgReplaceOne     = title("record updated successfully")
	MsgDeleteOne      = title("record deleted successfully")
	MsgDeleteMany     = title("records deleted successfully")
	MsgSearchMany     = title("records found successfully")
	MsgNotFound       = title("not found")
)
View Source
var (
	PrefixBearer = http.CanonicalHeaderKey("bearer")
)

Authentication prefixes.

Functions

This section is empty.

Types

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 {
	Ressource string
	Path      map[string]string
	Query     map[string][]string
}

Vars holds extracted path and query parameters.

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 or an error if not found or empty (depending on errOnEmpty).

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 or an error if missing or empty (depending on errOnEmpty).

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