Documentation ¶
Index ¶
- func Init(db *gorm.DB, log *glog.Logger, cfg *config.Config)
- type AccessKey
- type DBExecutor
- func (dbe *DBExecutor) CountUsers(db *gorm.DB, user_ids []string) (count int64, err error)
- func (dbe *DBExecutor) CreateAccessKey(db *gorm.DB, key *AccessKey) (err error)
- func (dbe *DBExecutor) CreateUser(db *gorm.DB, user *User) (err error)
- func (dbe *DBExecutor) DeleteUser(tx *gorm.DB, userId string) (err error)
- func (dbe *DBExecutor) GetAccessKeyByOwner(tx *gorm.DB, owner string) (*AccessKey, error)
- func (dbe *DBExecutor) GetConf() *config.Config
- func (dbe *DBExecutor) GetUserById(tx *gorm.DB, userId string) (*User, error)
- func (dbe *DBExecutor) GetUserByName(tx *gorm.DB, userName string) (*User, error)
- func (dbe *DBExecutor) ListAccessKeys(db *gorm.DB, accessKeyIDs []string, owner string, limit int, offset int) (k []*AccessKey, err error)
- func (dbe *DBExecutor) ListUsers(db *gorm.DB, user_ids []string, limit int, offset int) (u []*User, err error)
- func (dbe *DBExecutor) UpdateUser(db *gorm.DB, user *User) (err error)
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccessKey ¶
type AccessKey struct { AccessKeyID string `gorm:"column:access_key_id;" json:"access_key_id"` AccessKeyName string `gorm:"column:access_key_name;" json:"access_key_name"` SecretAccessKey string `gorm:"column:secret_access_key;" json:"secret_access_key"` Description string `gorm:"column:description;" json:"description"` Owner string `gorm:"column:owner;" json:"owner"` Status string `gorm:"column:status;" json:"status"` IPWhiteList string `gorm:"column:ip_white_list;" json:"ip_white_list"` CreateTime int64 `gorm:"column:create_time;" json:"create_time"` StatusTime int64 `gorm:"column:status_time;" json:"status_time"` }
type DBExecutor ¶
var (
AccountExecutor *DBExecutor
)
func (*DBExecutor) CountUsers ¶
func (*DBExecutor) CreateAccessKey ¶
func (dbe *DBExecutor) CreateAccessKey( db *gorm.DB, key *AccessKey) (err error)
func (*DBExecutor) CreateUser ¶
func (dbe *DBExecutor) CreateUser( db *gorm.DB, user *User) (err error)
func (*DBExecutor) DeleteUser ¶
func (dbe *DBExecutor) DeleteUser(tx *gorm.DB, userId string) (err error)
func (*DBExecutor) GetAccessKeyByOwner ¶
func (*DBExecutor) GetConf ¶
func (dbe *DBExecutor) GetConf() *config.Config
func (*DBExecutor) GetUserById ¶
func (*DBExecutor) GetUserByName ¶
func (*DBExecutor) ListAccessKeys ¶
func (*DBExecutor) UpdateUser ¶
func (dbe *DBExecutor) UpdateUser( db *gorm.DB, user *User) (err error)
type User ¶
type User struct { UserID string `gorm:"column:user_id;"` UserName string `gorm:"column:user_name;"` Password string `gorm:"column:password"` Lang string `gorm:"column:lang;default:'cn'"` Email string `gorm:"column:email;"` Phone string `gorm:"column:phone;"` Status string `gorm:"column:status;"` Role string `gorm:"column:role;default:'user'"` Currency string `gorm:"column:currency;default:'CNY'"` GravatarEmail string `gorm:"column:gravatar_email;"` Privilege int32 `gorm:"column:privilege;default:1"` Zones string `gorm:"column:zones;"` Regions string `gorm:"column:regions;"` StatusTime int64 `gorm:"column:status_time"` CreateTime int64 `gorm:"column:create_time"` }
func (*User) ToUserReply ¶
Click to show internal directories.
Click to hide internal directories.