dao

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: MIT Imports: 5 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(inter interface{}, f func(i interface{}) map[string]interface{}) (interface{}, int)

func GetObjectID

func GetObjectID(id interface{}) (primitive.ObjectID, error)

Types

type CommonDoc

type CommonDoc struct {
	Records []*Record
}

func (*CommonDoc) AddRecord

func (c *CommonDoc) AddRecord(u LogUser, msg string) []*Record

func (*CommonDoc) GetC

func (u *CommonDoc) GetC() string

func (*CommonDoc) SetCreator

func (c *CommonDoc) SetCreator(lu LogUser)

type DocInter

type DocInter interface {
	GetC() string
	GetDoc() interface{}
	GetID() interface{}
	SetCreator(u LogUser)
	AddRecord(u LogUser, msg string) []*Record
	GetIndexes() []mongo.IndexModel
}

type ListDoc

type ListDoc interface {
	GetID() string
	GetC() string
	GetList(slice interface{}) []ListDoc
	BeforeSave() error
}

type LogUser

type LogUser interface {
	GetName() string
	GetAccount() string
}

type Record added in v0.6.9

type Record struct {
	Datetime time.Time
	Summary  string
	Account  string
	Name     string
}

func NewRecord added in v0.6.8

func NewRecord(date time.Time, acc, name, msg string) *Record

Jump to

Keyboard shortcuts

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