dao

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

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

Dao dao.

func New

func New(c *conf.Config) *Dao

New init mysql db.

func (*Dao) AddEventLog

func (d *Dao) AddEventLog(eventLog *model.EventLog) error

AddEventLog Add Event Log.

func (*Dao) AddHookURL

func (d *Dao) AddHookURL(hookURL *model.HookUrl) error

AddHookURL Add Hook URL.

func (*Dao) AddHookURLandEvent

func (d *Dao) AddHookURLandEvent(hookURL *model.HookUrl, urlEvents []*model.UrlEvent) (err error)

AddHookURLandEvent Add Hook URL and Event.

func (*Dao) AddURLEvent

func (d *Dao) AddURLEvent(urlEvent *model.UrlEvent) error

AddURLEvent Add URL Event.

func (*Dao) CallHookUrl

func (d *Dao) CallHookUrl(c context.Context, URL string, body interface{}) (err error)

CallHookUrl Call Hook Url.

func (*Dao) CallHookUrlAsForm

func (d *Dao) CallHookUrlAsForm(c context.Context, URL string, body map[string]interface{}) (err error)

CallHookUrlAsForm Call Hook Url As Form.

func (*Dao) Close

func (d *Dao) Close()

Close close the resource.

func (*Dao) FindEventLogs

func (d *Dao) FindEventLogs(req *model.QueryEventLogReq) (total int64, eventLogs []*model.EventLog, err error)

FindEventLogs Find Event Logs.

func (*Dao) FindHookURLs

func (d *Dao) FindHookURLs(req *model.QueryHookURLReq) (total int64, hookURLs []*model.HookUrl, err error)

FindHookURLs Find Hook URLs.

func (*Dao) GetEnableHookURLFromCache

func (d *Dao) GetEnableHookURLFromCache(event model.Event) (hookURLs []*model.HookUrl, err error)

GetEnableHookURLFromCache Get Enable Hook URL From Cache.

func (*Dao) GetEnableHookURLFromCacheAndSaveIfNot

func (d *Dao) GetEnableHookURLFromCacheAndSaveIfNot(event model.Event) (hookURLs []*model.HookUrl, err error)

GetEnableHookURLFromCacheAndSaveIfNot Get Enable Hook URL From Cache and save if not.

func (*Dao) GetEnableHookURLFromDB

func (d *Dao) GetEnableHookURLFromDB(event model.Event) (hookURLs []*model.HookUrl, err error)

GetEnableHookURLFromDB Get Enable Hook URL From DB.

func (*Dao) Ping

func (d *Dao) Ping(c context.Context) (err error)

Ping verify server is ok.

func (*Dao) QueryHookURLByID

func (d *Dao) QueryHookURLByID(id int64) (hookURL *model.HookUrl, err error)

QueryHookURLByID Query Hook URL By ID.

func (*Dao) QueryURLEventByEventAndStatus

func (d *Dao) QueryURLEventByEventAndStatus(event string, status int) (urlEvents []*model.UrlEvent, err error)

QueryURLEventByEventAndStatus Query URL Event By Event and status.

func (*Dao) QueryURLEventByStatus

func (d *Dao) QueryURLEventByStatus(status int) (urlEvents []*model.UrlEvent, err error)

QueryURLEventByStatus Query URL Event By Status.

func (*Dao) QueryURLEventByUrl

func (d *Dao) QueryURLEventByUrl(urlID int64) (urlEvents []*model.UrlEvent, err error)

QueryURLEventByUrl Query URL Event By Url.

func (*Dao) QueryURLEventByUrlAndEvent

func (d *Dao) QueryURLEventByUrlAndEvent(urlID int64, eventType string) (urlEvents []*model.UrlEvent, err error)

QueryURLEventByUrlAndEvent Query URL Event By Url And Event.

func (*Dao) SaveEnableHookURLToCache

func (d *Dao) SaveEnableHookURLToCache() (eventMap map[string][]*model.HookUrl, err error)

SaveEnableHookURLToCache Save Enable Hook URL To Cache.

func (*Dao) UpdateEventLog

func (d *Dao) UpdateEventLog(eventLog *model.EventLog) error

UpdateEventLog Update Event Log.

func (*Dao) UpdateHookURL

func (d *Dao) UpdateHookURL(hookURL *model.HookUrl) error

UpdateHookURL Update Hook URL.

func (*Dao) UpdateHookURLandEvent

func (d *Dao) UpdateHookURLandEvent(hookURL *model.HookUrl, urlEvents []*model.UrlEvent) (err error)

UpdateHookURLandEvent Update Hook URL and Event.

func (*Dao) UpdateURLEventStatus

func (d *Dao) UpdateURLEventStatus(id int64, status int) error

UpdateURLEventStatus Update URL Event status.

Jump to

Keyboard shortcuts

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