dao

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2019 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
	DelResult(id interface{})
	GetResults() ([]*Result, error)
	GetResultById(id uint64) (*Result, error)
	Search(q string, limit, start int, sort string, asc bool) (int, float64, []Result)
	Debug(is_debug bool)
	Close() error
}

func NewDao

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

type PeanutContainer

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

func (*PeanutContainer) AddResult

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

func (*PeanutContainer) Close added in v1.0.4

func (this *PeanutContainer) Close() error

func (*PeanutContainer) Debug

func (this *PeanutContainer) Debug(is_debug bool)

func (*PeanutContainer) DelResult

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

func (*PeanutContainer) GetResultById

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

func (*PeanutContainer) GetResults

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

func (*PeanutContainer) Search

func (this *PeanutContainer) Search(q string, limit, start int, sort string, asc bool) (int, float64, []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