db

package
v0.0.0-...-9d0575d Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2014 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

func New

func New() *Database

func (*Database) Auth

func (db *Database) Auth(id uint64, pass string) (bool, error)

func (*Database) Close

func (db *Database) Close()

func (*Database) GroupAdd

func (db *Database) GroupAdd(group *Group) error

func (*Database) GroupDel

func (db *Database) GroupDel(id uint64) error

func (*Database) GroupGet

func (db *Database) GroupGet(id uint64) (*Group, error)

func (*Database) GroupList

func (db *Database) GroupList(pageno int, count int) (int64, []*Group, error)

func (*Database) GroupMemberAdd

func (db *Database) GroupMemberAdd(groupMember *GroupMember) error

func (*Database) GroupMemberDel

func (db *Database) GroupMemberDel(id uint64) error

func (*Database) GroupMemberGet

func (db *Database) GroupMemberGet(id uint64) (*GroupMember, error)

func (*Database) GroupMemberList

func (db *Database) GroupMemberList(groupId uint64, pageno int, count int) (int64, []*GroupMember, error)

func (*Database) GroupUpdate

func (db *Database) GroupUpdate(group *Group) error

func (*Database) IsGroup

func (db *Database) IsGroup(name string) ([]string, error)

func (*Database) UserAdd

func (db *Database) UserAdd(user *User) error

func (*Database) UserDel

func (db *Database) UserDel(id uint64) error

func (*Database) UserGet

func (db *Database) UserGet(id uint64) (*User, error)

func (*Database) UserGetByName

func (db *Database) UserGetByName(name string) (*User, error)

func (*Database) UserList

func (db *Database) UserList(pageno int, count int, ids []uint64, column string, order string, match string) (int64, []*User, error)

func (*Database) UserUpdate

func (db *Database) UserUpdate(user *User) error

type Group

type Group struct {
	Id      uint64    `xorm:"pk autoincr" json:"id"`
	Name    string    `xorm:"varchar(255) not null unique 'name'" json:"name"`
	Domain  string    `xorm:"varchar(255) not null 'domain'" json:"domain"`
	Created time.Time `xorm:"created" json:"created"`
	Updated time.Time `xorm:"updated" json:"updated"`
}

type GroupMember

type GroupMember struct {
	Id      uint64    `xorm:"pk autoincr" json:"id"`
	UserId  uint64    `xorm:"BigInt not null" json:"userId"`
	GroupId uint64    `xorm:"BigInt not null" json:"groupId"`
	Created time.Time `xorm:"created" json:"created"`
	Updated time.Time `xorm:"updated" json:"updated"`
}

type User

type User struct {
	Id       uint64    `xorm:"pk autoincr" json:"id"`
	Username string    `xorm:"varchar(255) not null unique 'username'" json:"username"`
	Password string    `xorm:"varchar(255) not null 'password'" json:"password"`
	Domain   string    `xorm:"varchar(255) not null 'domain'" json:"domain"`
	Created  time.Time `xorm:"created" json:"created"`
	Updated  time.Time `xorm:"updated" json:"updated"`
}

Jump to

Keyboard shortcuts

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