common

package
v3.1.0-rc.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTags

func GetTags(target interface{}) []string

GetTags parse a object and get the all tags

func GoRun

func GoRun(callback func(), exception func())

GoRun start a goroutine

func SetValueToMapStrByTags

func SetValueToMapStrByTags(source interface{}) types.MapStr

SetValueToMapStrByTags convert a struct to MapStr by tags

func SetValueToStructByTags

func SetValueToStructByTags(target interface{}, values types.MapStr) error

SetValueToStructByTags set the struct object field value by tags

func UUID

func UUID() string

UUID a gloable id

Types

type Condition

type Condition interface {
	SetStart(start int)
	GetStart() int
	SetLimit(limit int)
	GetLimit() int
	SetSort(sort string)
	GetSort() string
	Field(fieldName string) Field
	ToMapStr() types.MapStr
}

Condition condition interface

func CreateCondition

func CreateCondition() Condition

CreateCondition create a condition object

type Field

type Field interface {
	Eq(val interface{}) Condition
	NotEq(val interface{}) Condition
	Like(val interface{}) Condition
	In(val interface{}) Condition
	NotIn(val interface{}) Condition
	Lt(val interface{}) Condition
	Lte(val interface{}) Condition
	Gt(val interface{}) Condition
	Gte(val interface{}) Condition
	ToMapStr() types.MapStr
}

Field create a field

Jump to

Keyboard shortcuts

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