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"
)

Source Files