shared

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//YAMLExt yaml extension
	YAMLExt = ".yaml"
	//JSONExt json extension
	JSONExt = ".json"
)
View Source
const (
	//StatusOK response status ok
	StatusOK = "ok"
	//StatusRunning represents running status
	StatusRunning = "running"
	//StatusNoMatch response rule no matched status
	StatusNoMatch = "moMatch"
	//StatusError response error status
	StatusError = "error"
)
View Source
const (
	//BindingPath binding Path source
	BindingPath = "Path"
	//BindingQueryString binding query string source
	BindingQueryString = "QueryString"
	//BindingDataView binding view view source
	BindingDataView = "DataView"
	//BindingBodyData binding view source
	BindingBodyData = "BodyData"
	//BindingDataPool binding view source
	BindingDataPool = "DataPool"
	//BindingHeader binding header source
	BindingHeader = "Header"
)
View Source
const (
	//DialectSQL dialect supporting LIMIT/OFFSET keyword
	DialectSQL = "ParametrizedSQL" //regular LIMIT/OFFSET
	//DialectSQL2008 dialect ParametrizedSQL 2008
	DialectSQL2008 = "SQL2008" //FETCH
)

The following section defines constant for pagination template dialect (https://en.wikipedia.org/wiki/Select_(SQL)#FETCH_FIRST_clause)

View Source
const (

	//ErrorTypeException unexpected error
	ErrorTypeException = "exception"
	//ErrorTypeInvalidRule invalid rule
	ErrorTypeInvalidRule = "invalidRule"
	//ErrorTypeDataValidation invalid validation
	ErrorTypeDataValidation = "invalid"
	//ErrorTypeCache cache error
	ErrorTypeCache = "cache"
	//ErrorTypeRule rule error
	ErrorTypeRule = "rule"
)
View Source
const (
	//CardinalityOne cardinality one
	CardinalityOne = "One"
	//CardinalityMany cardinality many
	CardinalityMany = "Many"
)
View Source
const (
	//JoinTypeLeft left join type
	JoinTypeLeft = "LEFT"
	//JoinTypeInner inner join type
	JoinTypeInner = "INNER"
)
View Source
const (
	//FieldsKey fields key
	FieldsKey = "_fields"
	//OrderByKey order by key
	OrderByKey = "_orderBy"
	//CriteriaKey criteria key
	CriteriaKey = "_criteria"
	//ParamsKey optional criteria parameter key
	ParamsKey = "_params"
	//LimitKey limit key
	LimitKey = "_limit"
	//OffsetKey offset key
	OffsetKey = "_offset"
	//Metrics view only query strning
	Metrics = "_metrics"
)
View Source
const (
	MetricsAll   = "all"
	MetricsBasic = "basic"
)
View Source
const (
	//EncodingGzip encoding gzip
	EncodingGzip = "gzip"
	//ContentType JSON
	ContentTypeJSON = "application/json"
	CharsetUTF8     = "charset=utf-8"
	ContentLength   = "Content-Length"
)
View Source
const (
	ColumnTypeBit     = "BIT"
	ColumnTypeBoolean = "BOOLEAN"
	ColumnTypeTinyInt = "TINYINT"

	ColumnTypeInt      = "INT"
	ColumnTypeInteger  = "INTEGER"
	ColumnTypeInt64    = "INT64"
	ColumnTypeSmallInt = "SMALLINT"
	ColumnTypeBigInt   = "BigNT"

	ColumnTypeDecimal = "DECIMAL"
	ColumnTypeFloat   = "FLOAT"
	ColumnTypeFloat64 = "FLOAT64"
	ColumnTypeNumeric = "NUMERIC"
	ColumnTypeNumber  = "NUMBER"

	ColumnTypeChar     = "CHAR"
	ColumnTypeVarchar  = "VARCHAR"
	ColumnTypeVarchar2 = "VARCHAR2"
	ColumnTypeString   = "STRING"
	ColumnTypeCBlob    = "CBLOB"
	ColumnTypeText     = "TEXT"

	ColumnTypeDate        = "DATE"
	ColumnTypeDateTime    = "DATETIME"
	ColumnTypeTimestamp   = "TIMESTAMP"
	ColumnTypeTimestampTz = "TIMESTAMPTZ"
)
View Source
const (
	//ConfigKey config env key
	ConfigKey = "CONFIG"
)
View Source
const (
	//DefaultDataOutputKey output key
	DefaultDataOutputKey = "Root"
)
View Source
const (
	//EventCreateTimeHeader
	EventCreateTimeHeader = "Event-Create-Time"
)
View Source
const LoggingEnvKey = "LOGGING"

LoggingEnvKey logging key

Variables

View Source
var FilterAbortRequestError = errors.New("aborted")

FilterAbortRequestError abort request

Functions

func Compress

func Compress(reader io.Reader) (*bytes.Buffer, error)

Compress compress

func ElapsedInMs

func ElapsedInMs(started time.Time) int

ElapsedInMs return elapsed duration in ms

func GetKey

func GetKey(view string, sql *dsc.ParametrizedSQL) string

GetKey returns key

func IsFnLoggingEnabled

func IsFnLoggingEnabled(key string) bool

IsFnLoggingEnabled returns true if logging is enabled

func IsLoggingEnabled

func IsLoggingEnabled() bool

IsLoggingEnabled returns true if logging enabled

Types

type Handle

type Handle func(writer http.ResponseWriter, request *http.Request)

Handle represents http handle

Jump to

Keyboard shortcuts

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