base

package
v1.0.29 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ID = "_id"

Variables

This section is empty.

Functions

func GetFieldName

func GetFieldName(field reflect.StructField) string

通过反射获取字段名称

func GetFieldValue

func GetFieldValue(val reflect.Value) interface{}

获取字段的实际值

func In

func In(target string, str_array []string) bool

判断字符串是否包含在数组内

Types

type BaseId

type BaseId struct {
	//主键
	Id *primitive.ObjectID `bson:"_id" json:"_id"`
	//创建时间
	CreatedAt *time.Time `bson:"createdAt" json:"createdAt,omitempty" update:"setOnInsert"`
	//修改时间
	UpdatedAt *time.Time `bson:"updatedAt" json:"updatedAt,omitempty"`
}

默认类型

Jump to

Keyboard shortcuts

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