dao

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const MAXROWS = 999999999

MAXROWS : Max amount of rows returns per page

View Source
const PAGEROWS = 20

PAGEROWS : Normal amount of rows return per page

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseDao

type BaseDao struct {
	CreatedTime time.Time `orm:"auto_now_add;type(datetime)" json:"created_time"`
	UpdatedTime time.Time `orm:"auto_now;type(datetime)" json:"updated_time"`
	// contains filtered or unexported fields
}

BaseDao : Wrap of dao

func (*BaseDao) SetPageParams

func (bd *BaseDao) SetPageParams(start int, limit int)

SetPageParams : Set pagination params

func (*BaseDao) SetSearchCdt

func (bd *BaseDao) SetSearchCdt(q []string)

SetSearchCdt : Set search conditions

func (*BaseDao) SetSearchMap

func (bd *BaseDao) SetSearchMap(sm map[string]interface{})

SetSearchMap : Set search conditions

type CenterConfig

type CenterConfig struct {
	Id      int    `json:"id"`
	Env     string `json:"env" orm:"column(env)"`
	Mod     string `json:"mod"`
	Key     string `json:"key"`
	Val     string `json:"val"`
	Type    string `json:"type"`
	Version string `json:"version"`
	BaseDao
}

CenterConfig : Table structure

func (*CenterConfig) Create

func (cc *CenterConfig) Create() (int64, error)

Create record according to dto

func (*CenterConfig) Delete

func (cc *CenterConfig) Delete() error

Delete record according to dto

func (*CenterConfig) Find

func (cc *CenterConfig) Find() error

Find : Get records by id

func (*CenterConfig) List

func (cc *CenterConfig) List() (interface{}, int64)

List with params of pagination & search conditions

func (*CenterConfig) TableName

func (*CenterConfig) TableName() string

TableName : Return table's name in database

func (*CenterConfig) Update

func (cc *CenterConfig) Update() error

Update record according to dto

type MetaCache

type MetaCache struct{}

MetaCache : Meta data storage

func (MetaCache) Delete

func (e MetaCache) Delete(key string) (interface{}, error)

Delete by key

func (MetaCache) Get

func (e MetaCache) Get(key string) (interface{}, error)

Get specific key

func (MetaCache) Put

func (e MetaCache) Put(key, val string) (interface{}, error)

Put : Update key with value

Jump to

Keyboard shortcuts

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