orr

package module
v0.0.0-...-fcdecfa Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2014 License: MIT Imports: 9 Imported by: 0

README

orr

object reflect to redis, for golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppElement

func AppElement(obj interface{}, fieldname string, args ...interface{})

向slice或map中追加一个元素, 并保存 当map时, 使用HSET 当slice时, 使用RPUSH

func BuildRelation

func BuildRelation()

func Delete

func Delete(obj interface{}) error

func DeleteKeyField

func DeleteKeyField(typ string, name string, fn string, id int64)

func Insert

func Insert(obj interface{}, index bool) (int64, error)

Insert用于初次数据到redis中,检查struct的tags,并根据tags的定义, 来设置redis的辅助字段 返回Id

func InsertKeyField

func InsertKeyField(typ, name string, fn string, id int64, value interface{}) error

将结构体的field插入到数据库中 typ should be "key" or "hash"

func NewId

func NewId(name string) int64

func OpenRedis

func OpenRedis(proto, addr string)

func RemElement

func RemElement(obj interface{}, fieldname string, args ...interface{}) error

从slice或map中删除一个元素, 并保存

func Restore

func Restore(obj interface{}, fieldname string) error

从redis中恢复数据

func ReturnId

func ReturnId(name string, id int64)

func Save

func Save(obj interface{}, fieldname string) error

将数据结构Marshal, 并保存

func Select

func Select(Id int64, name string, res interface{}) error

从redis中还原数据

func SelectIndex

func SelectIndex(name, fn, value string) (int64, error)

func SelectKeyField

func SelectKeyField(keyTyp string, name string,
	fn string, id int64, res interface{}) (err error)

func Update

func Update(obj interface{}, objName string, objId int64) error

仅更新主hashmap

Types

This section is empty.

Jump to

Keyboard shortcuts

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