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: 8 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 *Dao)

New init memcache

func (*Dao) AddCache

func (d *Dao) AddCache(c context.Context, key string, val []byte) (err error)

AddCache add page to cache

func (*Dao) ClearCache

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

ClearCache clear all page cache

func (*Dao) Close

func (d *Dao) Close()

Close close the resource.

func (*Dao) DelCache

func (d *Dao) DelCache(c context.Context, key string) (err error)

DelCache delete page cache

func (*Dao) GetCache

func (d *Dao) GetCache(c context.Context, key string) (res []byte, err error)

GetCache get page from cache

func (*Dao) GetFile

func (d *Dao) GetFile(c context.Context, path string) (res []byte, err error)

GetFile get page from file

func (*Dao) GetItem

func (d *Dao) GetItem(c context.Context, id int, bot bool) (res []byte, err error)

GetItem get item page

func (*Dao) GetPro

func (d *Dao) GetPro(c context.Context, id int, bot bool) (res []byte, err error)

GetPro get project page

func (*Dao) GetUrl

func (d *Dao) GetUrl(c context.Context, url string) (res []byte, err error)

GetUrl get page from url

func (*Dao) Ping

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

Ping dao ping

func (*Dao) Sitemap

func (d *Dao) Sitemap(c context.Context, host string) (res []byte, err error)

Sitemap 生成站点地图

Jump to

Keyboard shortcuts

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