dao

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package dao

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, dao Dao)

Register makes a config adapter available by the adapter name. If Register is called twice with the same name or if driver is nil, it panics.

Types

type Dao

type Dao interface {
	NewDaoImpl(dsn string) (DaoContainer, error)
}

type DaoContainer

type DaoContainer interface {
	AddResult(p *Result) error
	AddResults(p []Result)
	DelResult(id interface{})
	DelResults(source string)
	UpdateResult(p *Result)
	AddOrUpdate(p *Result)
	GetResults() ([]*Result, error)
	GetResultById(id uint64) (*Result, error)
	GetResultByLink(url string) *Result
	GetResult(author, sort string, limit, start int) []Result
	IsResultUpdate(p *Result) bool
	Search(q string, limit, start int) (int, float64, []Result)
	Debug(is_debug bool)
}

func NewDao

func NewDao(dao_name, dsn string) (DaoContainer, error)

type PeanutContainer

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

func (*PeanutContainer) AddOrUpdate

func (this *PeanutContainer) AddOrUpdate(p *Result)

func (*PeanutContainer) AddResult

func (this *PeanutContainer) AddResult(p *Result) error

func (*PeanutContainer) AddResults

func (this *PeanutContainer) AddResults(p []Result)

func (*PeanutContainer) Debug

func (this *PeanutContainer) Debug(is_debug bool)

func (*PeanutContainer) DelResult

func (this *PeanutContainer) DelResult(id interface{})

func (*PeanutContainer) DelResults

func (this *PeanutContainer) DelResults(source string)

func (*PeanutContainer) GetResult

func (this *PeanutContainer) GetResult(author, sort string, limit, start int) []Result

func (*PeanutContainer) GetResultById

func (this *PeanutContainer) GetResultById(id uint64) (*Result, error)
func (this *PeanutContainer) GetResultByLink(url string) *Result

func (*PeanutContainer) GetResults

func (this *PeanutContainer) GetResults() ([]*Result, error)

func (*PeanutContainer) IsResultUpdate

func (this *PeanutContainer) IsResultUpdate(p *Result) bool

func (*PeanutContainer) Search

func (this *PeanutContainer) Search(q string, limit, start int) (int, float64, []Result)

func (*PeanutContainer) UpdateResult

func (this *PeanutContainer) UpdateResult(p *Result)

type PeanutDao

type PeanutDao struct {
}

func (*PeanutDao) NewDaoImpl

func (this *PeanutDao) NewDaoImpl(dsn string) (DaoContainer, error)

Jump to

Keyboard shortcuts

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