base

package module
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: MIT Imports: 0 Imported by: 43

README

base

base 是 infrago 的基础类型包(Map/Any/Res 等),供模块和驱动复用。

Documentation

Index

Constants

View Source
const (
	GET     = "get"
	POST    = "post"
	PUT     = "put"
	DELETE  = "delete"
	PATCH   = "patch"
	OPTIONS = "options"
	HEAD    = "head"
	CONNECT = "connect"
	TRACE   = "trace"
)
View Source
const (
	ASC  = 1
	DESC = -1

	BYASC  = "asc"
	BYDESC = "desc"
)
View Source
const (
	OpAnd       = "$and"
	OpOr        = "$or"
	OpNor       = "$nor"
	OpNot       = "$not"
	OpEq        = "$eq"
	OpNe        = "$ne"
	OpGt        = "$gt"
	OpGte       = "$gte"
	OpLt        = "$lt"
	OpLte       = "$lte"
	OpIn        = "$in"
	OpNin       = "$nin"
	OpLike      = "$like"
	OpILike     = "$ilike"
	OpRegex     = "$regex"
	OpContains  = "$contains"
	OpOverlap   = "$overlap"
	OpElemMatch = "$elemMatch"
	OpExists    = "$exists"
	OpNull      = "$null"
	OpRange     = "$range"
)
View Source
const (
	OptSelect      = "$select"
	OptFields      = "$fields"
	OptSort        = "$sort"
	OptSorts       = "$sorts"
	OptLimit       = "$limit"
	OptOffset      = "$offset"
	OptAfter       = "$after"
	OptWithCount   = "$withCount"
	OptGroup       = "$group"
	OptHaving      = "$having"
	OptJoin        = "$join"
	OptAgg         = "$agg"
	OptUnsafe      = "$unsafe"
	OptBatch       = "$batch"
	OptWithDeleted = "$withDeleted"
	OptOnlyDeleted = "$onlyDeleted"
	OptUnscoped    = "$unscoped"

	OptFilter    = "$filter"
	OptFilters   = "$filters"
	OptKeyword   = "$keyword"
	OptQuery     = "$q"
	OptPrefix    = "$prefix"
	OptFacets    = "$facets"
	OptHighlight = "$highlight"
	OptRaw       = "$raw"
	OptSetting   = "$setting"
)
View Source
const (
	UpdSet       = "$set"
	UpdInc       = "$inc"
	UpdUnset     = "$unset"
	UpdPush      = "$push"
	UpdPull      = "$pull"
	UpdAddToSet  = "$addToSet"
	UpdSetPath   = "$setPath"
	UpdUnsetPath = "$unsetPath"
)

Variables

View Source
var (
	Nil = Var{/* contains filtered or unexported fields */}
)

Functions

This section is empty.

Types

type Any

type Any = interface{}

type Map

type Map = map[string]Any

type Res

type Res interface {
	OK() bool
	Fail() bool
	Code() int
	Status() string
	Args() []Any
	With(...Any) Res
	Retry(...bool) Res
	Retriable() bool
	Error() string
}

type Var

type Var struct {
	Type      string
	Required  bool
	Nullable  bool
	Name      string
	Text      string
	Default   Any
	Unique    bool
	Check     string
	Collation string
	Comment   string
	Setting   Map
	Options   Map
	Children  Vars
	Encode    string
	Decode    string
	Empty     Res
	Error     Res
	Valid     func(Any, Var) bool
	Value     func(Any, Var) Any
	// contains filtered or unexported fields
}

func (*Var) Nil

func (vvv *Var) Nil() bool

type Vars

type Vars map[string]Var

Jump to

Keyboard shortcuts

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