apiv3

package
v0.0.0-...-f6ca644 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFilterAllParams

func GetFilterAllParams(all []All, query db.Map) (int, error)

GetFilterAllParams function

func GetFilterGeoIntersectsParams

func GetFilterGeoIntersectsParams(geoIntersects []GeoIntersects, query db.Map) (int, error)

GetFilterGeoIntersectsParams function

func GetFilterGeoWithinParams

func GetFilterGeoWithinParams(geoWithin []GeoWithin, query db.Map) (int, error)

GetFilterGeoWithinParams function

func GetFilterInParams

func GetFilterInParams(in []In, query db.Map) (int, error)

GetFilterInParams function

func GetFilterNearParams

func GetFilterNearParams(nears []Near, query db.Map) (int, error)

GetFilterNearParams function

func GetFilterNotInParams

func GetFilterNotInParams(in []NotIn, query db.Map) (int, error)

GetFilterNotInParams function

func GetFilterRangeParams

func GetFilterRangeParams(ranges []Range, query db.Map) (int, error)

GetFilterRangeParams function

func GetMatchValue

func GetMatchValue(i interface{}) interface{}

GetMatchValue function

func GetMatchValueOp

func GetMatchValueOp(i interface{}) interface{}

GetMatchValueOp function

func GetQueryElemMatchParams

func GetQueryElemMatchParams(elemMatch []*ElemMatch, query db.Map) (int, error)

GetQueryElemMatchParams function

func GetQueryLikeParams

func GetQueryLikeParams(like []*Like, query db.Map) (int, error)

GetQueryLikeParams function

func GetQueryMatchParams

func GetQueryMatchParams(match []*Match, query db.Map) (int, error)

GetQueryMatchParams function

func GetQueryMatchParamsReturn

func GetQueryMatchParamsReturn(match []*Match) (db.Map, error)

GetQueryMatchParamsReturn function

func ParseAllValue

func ParseAllValue(i []interface{}) db.Map

ParseAllValue function

func ParseElemMatchValue

func ParseElemMatchValue(elemMatch *ElemMatch, query db.Map) (err error)

ParseElemMatchValue function

func ParseInValue

func ParseInValue(i []interface{}) db.Map

ParseInValue function

func ParseLikeValue

func ParseLikeValue(like *Like, query db.Map) error

ParseLikeValue function

func ParseMatchValue

func ParseMatchValue(match *Match, query db.Map) error

ParseMatchValue function

func ParseMatchValueReturn

func ParseMatchValueReturn(match *Match) (db.Map, error)

ParseMatchValueReturn function

func ParseNotInValue

func ParseNotInValue(i []interface{}) db.Map

ParseNotInValue function

func ParseSearchQuery

func ParseSearchQuery(params Params, required ...bool) (db.Map, error)

ParseSearchQuery function

func ParseSubAttributes

func ParseSubAttributes(i, o Attributes, key *string)

ParseSubAttributes function

Types

type All

type All struct {
	Key   string        `json:"key" bson:"key" binding:"required"`
	Value []interface{} `json:"value" bson:"value"`
}

All struct

type Attributes

type Attributes map[string]interface{}

Attributes type

func NewAttributes

func NewAttributes(i interface{}) (*Attributes, error)

NewAttributes function

func (*Attributes) Delete

func (a *Attributes) Delete(key string) error

Delete method

func (*Attributes) Get

func (a *Attributes) Get(key string) interface{}

Get method

func (*Attributes) GetArrayFloat32

func (a *Attributes) GetArrayFloat32(key string) (values []float32)

GetArrayFloat32 method

func (*Attributes) GetArrayFloat64

func (a *Attributes) GetArrayFloat64(key string) (values []float64)

GetArrayFloat64 method

func (*Attributes) GetArrayInt

func (a *Attributes) GetArrayInt(key string) (values []int)

GetArrayInt method

func (*Attributes) GetArrayInterface

func (a *Attributes) GetArrayInterface(key string) []interface{}

GetArrayInterface method

func (*Attributes) GetArrayString

func (a *Attributes) GetArrayString(key string) (values []string)

GetArrayString method

func (*Attributes) GetFloat64

func (a *Attributes) GetFloat64(key string) float64

GetFloat64 method

func (*Attributes) GetInt

func (a *Attributes) GetInt(key string) int

GetInt method

func (*Attributes) GetString

func (a *Attributes) GetString(key string) string

GetString method

func (*Attributes) GetSubAttributes

func (a *Attributes) GetSubAttributes(key string) (*Attributes, error)

GetSubAttributes method

func (Attributes) KeyExists

func (a Attributes) KeyExists(key string) bool

KeyExists method

func (*Attributes) PairKeyTo

func (a *Attributes) PairKeyTo(key string, o interface{}) error

PairKeyTo method

func (*Attributes) PairTo

func (a *Attributes) PairTo(o interface{}) error

PairTo method

func (Attributes) ParseKeyValSetAttributes

func (a Attributes) ParseKeyValSetAttributes() Attributes

ParseKeyValSetAttributes method

func (*Attributes) Set

func (a *Attributes) Set(key string, val interface{}) error

Set method

type Claims

type Claims struct {
	Ver          string `json:"ver" bson:"ver"`
	Cre          string `json:"cre" bson:"cre"`
	Id           string `json:"id" bson:"id"`
	Jti          string `json:"jti" bson:"jti"`
	Iss          string `json:"iss" bson:"iss"`
	Aud          string `json:"aud" bson:"aud"`
	ClientId     string `json:"client_id" bson:"client_id"`
	Sub          string `json:"sub" bson:"sub"`
	Exp          int    `json:"exp" bson:"exp"`
	Expired      int    `json:"expires" bson:"expires"`
	Iat          int    `json:"iat" bson:"iat"`
	TokenType    string `json:"token_type" bson:"token_type"`
	Scope        string `json:"scope" bson:"scope"`
	UserId       string `json:"user_id" bson:"user_id"`
	CredentialId string `json:"credential_id" bson:"credential_id"`
}

Claims struct

func ParseTokenClaims

func ParseTokenClaims(c *gin.Context) *Claims

ParseTokenClaims function

func (*Claims) ReArrangeValues

func (claims *Claims) ReArrangeValues()

ReArrangeValues function

type ElemMatch

type ElemMatch struct {
	Key   string   `json:"key" bson:"key" binding:"required"`
	Value []*Match `json:"value" bson:"value"`
}

ElemMatch struct

type Error

type Error struct {
	Level          string      `json:"level,omitempty" bson:"level,omitempty"`
	Code           string      `json:"code" bson:"code" binding:"required"`
	Type           string      `json:"type,omitempty" bson:"type,omitempty"`
	Status         string      `json:"status,omitempty" bson:"status,omitempty"`
	Message        string      `json:"message,omitempty" bson:"message,omitempty"`
	MessageDetails string      `json:"message_details,omitempty" bson:"message_details,omitempty"`
	Refs           interface{} `json:"refs,omitempty" bson:"refs,omitempty"`
}

Error struct

func (Error) Err

func (e Error) Err() string

Err method

func (Error) Error

func (e Error) Error() error

Error method

func (Error) Log

func (e Error) Log()

Log method

type Filter

type Filter struct {
	Range         []Range         `json:"range" bson:"range"`
	In            []In            `json:"in" bson:"in"`
	NotIn         []NotIn         `json:"nin" bson:"nin"`
	All           []All           `json:"all" bson:"all"`
	Near          []Near          `json:"near" bson:"near"`
	GeoIntersects []GeoIntersects `json:"geo_intersects" bson:"geo_intersects"`
	GeoWithin     []GeoWithin     `json:"geo_within" bson:"geo_within"`
}

Filter struct

type GeoIntersects

type GeoIntersects struct {
	Key   string              `json:"key" bson:"key" binding:"required"`
	Value *GeoIntersectsValue `json:"value" bson:"value"`
}

GeoIntersects struct

type GeoIntersectsValue

type GeoIntersectsValue struct {
	Geometry *Geometry `json:"geometry,omitempty" bson:"geometry,omitempty"`
}

GeoIntersectsValue struct

type GeoWithin

type GeoWithin struct {
	Key   string          `json:"key" bson:"key" binding:"required"`
	Value *GeoWithinValue `json:"value" bson:"value"`
}

GeoWithin struct

type GeoWithinValue

type GeoWithinValue struct {
	Geometry *Geometry `json:"geometry,omitempty" bson:"geometry,omitempty"`
}

GeoWithinValue struct

type Geometry

type Geometry struct {
	Type        string        `json:"type,omitempty" bson:"type,omitempty"`
	Coordinates []interface{} `json:"coordinates,omitempty" bson:"coordinates,omitempty"`
}

Geometry with standard GeoJSON

type IError

type IError struct {
	Result  string `json:"result" bson:"result"  binding:"required"`
	Message string `json:"message,omitempty" bson:"message,omitempty"`
}

IError struct

type In

type In struct {
	Key   string        `json:"key" bson:"key" binding:"required"`
	Value []interface{} `json:"value" bson:"value"`
}

In struct

type Like

type Like struct {
	Key   string `json:"key" bson:"key" binding:"required"`
	Value string `json:"value" bson:"value"`
}

Like struct

type Limit

type Limit struct {
	Rows   int `json:"rows" bson:"rows"`
	Offset int `json:"offset" bson:"offset"`
}

Limit struct

type Match

type Match struct {
	Key   string      `json:"key" bson:"key" binding:"required"`
	Value interface{} `json:"value" bson:"value"`
}

Match struct

type Near

type Near struct {
	Key   string     `json:"key" bson:"key" binding:"required"`
	Value *NearValue `json:"value" bson:"value"`
}

Near struct

type NearValue

type NearValue struct {
	Geometry    *Geometry `json:"geometry,omitempty" bson:"geometry,omitempty"`
	MinDistance float64   `json:"min_distance,omitempty" bson:"min_distance,omitempty"`
	MaxDistance float64   `json:"max_distance,omitempty" bson:"max_distance,omitempty"`
}

NearValue struct

type NotIn

type NotIn struct {
	Key   string        `json:"key" bson:"key" binding:"required"`
	Value []interface{} `json:"value" bson:"value"`
}

NotIn struct

type Params

type Params struct {
	Query       Query       `json:"query" bson:"query"`
	CustomQuery interface{} `json:"custom_query,omitempty" bson:"custom_query,omitempty"`
	Filter      Filter      `json:"filter" bson:"filter"`
	Sort        []Sort      `json:"sort" bson:"sort"`
	Limit       Limit       `json:"limit" bson:"limit"`
	Data        interface{} `json:"data,omitempty" bson:"data,omitempty"`
	Options     interface{} `json:"options,omitempty" bson:"options,omitempty"`
}

Params struct

type Query

type Query struct {
	Match     []*Match     `json:"match" bson:"match"`
	Like      []*Like      `json:"like" bson:"like"`
	ElemMatch []*ElemMatch `json:"elem_match" bson:"elem_match"`
}

Query struct

type Range

type Range struct {
	Key   string      `json:"key" bson:"key" binding:"required"`
	Value *RangeValue `json:"value" bson:"value"`
}

Range struct

type RangeValue

type RangeValue struct {
	Gt  interface{} `json:"gt" bson:"gt"`
	Lt  interface{} `json:"lt" bson:"lt"`
	Gte interface{} `json:"gte" bson:"gte"`
	Lte interface{} `json:"lte" bson:"lte"`
}

RangeValue struct

type Request

type Request struct {
	Kind   string      `json:"kind" bson:"kind" binding:"required"`
	Values interface{} `json:"values" bson:"values" binding:"required"`
}

Request struct

func ParseRequest

func ParseRequest(c *gin.Context) (*Request, error)

ParseRequest function

type Response

type Response struct {
	ReturnVal bool        `json:"returnval" bson:"returnval" binding:"required"`
	RespVal   string      `json:"respval,omitempty" bson:"respval,omitempty"`
	Kind      string      `json:"kind,omitempty" bson:"kind,omitempty"`
	Values    interface{} `json:"values,omitempty" bson:"values,omitempty"`
	Error     interface{} `json:"error,omitempty" bson:"error,omitempty"`
}

Response struct

type Sort

type Sort struct {
	Key   string `json:"key" bson:"key" binding:"required"`
	Value string `json:"value" bson:"value"`
}

Sort struct

Jump to

Keyboard shortcuts

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