dao

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: MIT Imports: 6 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 CommonPipeline

type CommonPipeline struct {
	// contains filtered or unexported fields
}

func (*CommonPipeline) GetPipeline

func (u *CommonPipeline) GetPipeline() []bson.M

func (*CommonPipeline) GetQ

func (u *CommonPipeline) GetQ() bson.M

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 PipelineQryInter

type PipelineQryInter interface {
	GetQ() bson.M
	GetPipeline() []bson.M
}

Jump to

Keyboard shortcuts

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