Documentation ¶
Index ¶
- func Destroy()
- func GetSession() *mgo.Session
- func GlobalSession() *mgo.Session
- func NewMongodbColl(dbName, collName string) *mgo.Collection
- func NewMongodbDB(dbName string) *mgo.Database
- type MongoDB
- type MongoInfo
- type Permission
- type PermissionColl
- func (p *PermissionColl) Close()
- func (p *PermissionColl) Counts() int
- func (p *PermissionColl) Gather() ([]plugin.Permission, error)
- func (p *PermissionColl) Get(id string) (plugin.Permission, error)
- func (p *PermissionColl) GetByDesc(descrip string) (plugin.Permission, error)
- func (p *PermissionColl) Gets(skip, limit int, field string) ([]plugin.Permission, error)
- func (p *PermissionColl) New(name, des string) (string, error)
- func (p *PermissionColl) Update(id string, update map[string]string) error
- type Role
- type RoleColl
- func (r *RoleColl) Close()
- func (r *RoleColl) Counts() int
- func (r *RoleColl) Gather() ([]plugin.Role, error)
- func (r *RoleColl) Get(id string) (plugin.Role, error)
- func (r *RoleColl) GetByName(name string) (plugin.Role, error)
- func (r *RoleColl) Gets(skip, limit int, field string) ([]plugin.Role, error)
- func (r *RoleColl) New(name string) (string, error)
- func (r *RoleColl) Update(id string, update map[string]string) error
- type Store
- type User
- type UserColl
- func (u *UserColl) Close()
- func (u *UserColl) Counts() int
- func (u *UserColl) Gather() ([]plugin.User, error)
- func (u *UserColl) Get(id string) (plugin.User, error)
- func (u *UserColl) GetByUid(uid string) (plugin.User, error)
- func (u *UserColl) Gets(skip, limit int, field string) ([]plugin.User, error)
- func (u *UserColl) New(uid string) (string, error)
- func (u *UserColl) Update(id string, update map[string]string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSession ¶
func GetSession() *mgo.Session
func GlobalSession ¶
func GlobalSession() *mgo.Session
func NewMongodbColl ¶
func NewMongodbColl(dbName, collName string) *mgo.Collection
func NewMongodbDB ¶
func NewMongodbDB(dbName string) *mgo.Database
Types ¶
type Permission ¶
type Permission struct { Id bson.ObjectId `bson:"_id,omitempty" json:"id"` Name string `bson:"name" json:"name"` Descrip string `bson:"descrip" json:"descrip"` Sep string `bson:"sep" json:"sep"` CreateTime time.Time `bson:"createTime" json:"createTime"` UpdateTime time.Time `bson:"updateTime,omitempty" json:"updateTime"` }
func (Permission) GetCreateTime ¶ added in v1.0.1
func (p Permission) GetCreateTime() time.Time
func (Permission) GetDescrip ¶ added in v1.0.1
func (p Permission) GetDescrip() string
func (Permission) GetName ¶ added in v1.0.1
func (p Permission) GetName() string
func (Permission) GetSep ¶ added in v1.0.1
func (p Permission) GetSep() string
func (Permission) GetUpdateTime ¶ added in v1.0.1
func (p Permission) GetUpdateTime() time.Time
func (Permission) Getid ¶ added in v1.0.1
func (p Permission) Getid() string
type PermissionColl ¶
type PermissionColl struct {
*mgo.Collection
}
func (*PermissionColl) Close ¶ added in v1.0.1
func (p *PermissionColl) Close()
func (*PermissionColl) Counts ¶ added in v1.0.1
func (p *PermissionColl) Counts() int
func (*PermissionColl) Gather ¶ added in v1.0.1
func (p *PermissionColl) Gather() ([]plugin.Permission, error)
func (*PermissionColl) Get ¶ added in v1.0.1
func (p *PermissionColl) Get(id string) (plugin.Permission, error)
func (*PermissionColl) GetByDesc ¶ added in v1.0.1
func (p *PermissionColl) GetByDesc(descrip string) (plugin.Permission, error)
func (*PermissionColl) Gets ¶ added in v1.0.1
func (p *PermissionColl) Gets(skip, limit int, field string) ([]plugin.Permission, error)
type Role ¶
type Role struct { Id bson.ObjectId `bson:"_id,omitempty" json:"id"` Name string `bson:"name" json:"name"` Permissions string `bson:"permissions" json:"permissions"` CreateTime time.Time `bson:"createTime" json:"createTime"` UpdateTime time.Time `bson:"updateTime,omitempty" json:"updateTime"` }
func (Role) GetCreateTime ¶ added in v1.0.1
func (Role) GetPermissions ¶ added in v1.0.1
func (Role) GetUpdateTime ¶ added in v1.0.1
type RoleColl ¶
type RoleColl struct {
*mgo.Collection
}
type Store ¶ added in v1.0.1
type Store struct {
// contains filtered or unexported fields
}
func (*Store) GetPermissionPools ¶ added in v1.0.1
func (s *Store) GetPermissionPools() plugin.PermissionPools
func (*Store) GetRolePools ¶ added in v1.0.1
func (*Store) GetUserPools ¶ added in v1.0.1
type User ¶
type User struct { Id bson.ObjectId `bson:"_id,omitempty"` UserId string `bson:"user_id"` Roles string `bson:"roles"` CreateTime time.Time `bson:"createTime"` UpdateTime time.Time `bson:"updateTime,omitempty"` }
func (User) GetCreateTime ¶ added in v1.0.1
func (User) GetUpdateTime ¶ added in v1.0.1
Click to show internal directories.
Click to hide internal directories.