dao

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: MIT Imports: 5 Imported by: 21

Documentation

Index

Constants

View Source
const (
	PropFormatEmpty = ""
	PropFormatTime  = "epoch_second"
)

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)

func NewEsIndex added in v0.9.0

func NewEsIndex() *index

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 ESDao added in v0.9.0

type ESDao interface {
	GetType() string
	GetJsonBody() (string, error)
	GetID() string
	GetMapping() string
}

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

type SearchDaoList added in v0.9.0

type SearchDaoList []ESDao

func (SearchDaoList) Add added in v0.9.0

func (sdl SearchDaoList) Add(sd ESDao) error

Jump to

Keyboard shortcuts

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