Documentation ¶
Overview ¶
Package dao
Index ¶
- func Register(name string, dao Dao)
- type Dao
- type DaoContainer
- type PeanutContainer
- func (this *PeanutContainer) AddOrUpdate(p *Result)
- func (this *PeanutContainer) AddResult(p *Result) error
- func (this *PeanutContainer) AddResults(p []Result)
- func (this *PeanutContainer) Debug(is_debug bool)
- func (this *PeanutContainer) DelResult(id interface{})
- func (this *PeanutContainer) DelResults(source string)
- func (this *PeanutContainer) GetResult(author, sort string, limit, start int) []Result
- func (this *PeanutContainer) GetResultById(id uint64) (*Result, error)
- func (this *PeanutContainer) GetResultByLink(url string) *Result
- func (this *PeanutContainer) GetResults() ([]*Result, error)
- func (this *PeanutContainer) IsResultUpdate(p *Result) bool
- func (this *PeanutContainer) Search(q string, limit, start int) (int, float64, []Result)
- func (this *PeanutContainer) UpdateResult(p *Result)
- type PeanutDao
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 (*PeanutContainer) GetResultByLink ¶
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)
Click to show internal directories.
Click to hide internal directories.