dao

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetaTableName = "meta"
)

constant metatable name reference

Variables

This section is empty.

Functions

func DeleteMetaByKey

func DeleteMetaByKey(key string) error

DeleteMetaByKey delete meta by key

func InsertOrUpdate

func InsertOrUpdate(meta *Meta) error

InsertOrUpdate insert or update meta

func QueryAllMeta

func QueryAllMeta(key string, condition string) (*[]Meta, error)

QueryAllMeta return all meta, if no error, Meta not null

func QueryMeta

func QueryMeta(key string, condition string) (*[]string, error)

QueryMeta return only meta's value, if no error, Meta not null

func SaveMeta

func SaveMeta(meta *Meta) error

SaveMeta save meta to db

func UpdateMeta

func UpdateMeta(meta *Meta) error

UpdateMeta update meta

func UpdateMetaField

func UpdateMetaField(key string, col string, value interface{}) error

UpdateMetaField update special field

func UpdateMetaFields

func UpdateMetaFields(key string, cols map[string]interface{}) error

UpdateMetaFields update special fields

Types

type Meta

type Meta struct {
	// ID    int64  `orm:"pk; auto; column(id)"`
	Key   string `orm:"column(key); size(256); pk"`
	Type  string `orm:"column(type); size(32)"`
	Value string `orm:"column(value); null; type(text)"`
}

Meta metadata object

Jump to

Keyboard shortcuts

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