model

package
v0.0.0-...-afd247e Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close 关闭

func New

func New(c map[string]string) error

New 创建数据库连接并传入config

Types

type Log

type Log struct {
	ID        primitive.ObjectID     `bson:"_id" json:"id" valid:"-"`
	Type      Type                   `json:"type" bson:"type" valid:"required"`
	From      string                 `json:"from" bson:"from" valid:"required"`
	Content   map[string]interface{} `json:"content" bson:"content" valid:"required"`
	CreatedAt time.Time              `bson:"createdAt" json:"createdAt" valid:"required"`
}

type Type

type Type string

Type 记录类型

const (
	// Error 错误记录类型
	Error Type = "error"
	// Info 信息记录类型
	Info Type = "info"
	// Modification 变更记录类型
	Modification Type = "modification"
)

Jump to

Keyboard shortcuts

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