executor

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(db *gorm.DB, log *glog.Logger, cfg *config.Config)

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"`
}

func (AccessKey) TableName

func (k AccessKey) TableName() string

type DBExecutor

type DBExecutor struct {
	Db *gorm.DB
	// contains filtered or unexported fields
}
var (
	AccountExecutor *DBExecutor
)

func (*DBExecutor) CountUsers

func (dbe *DBExecutor) CountUsers(
	db *gorm.DB, user_ids []string) (count int64, err error)

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 (dbe *DBExecutor) GetAccessKeyByOwner(tx *gorm.DB, owner string) (*AccessKey, error)

func (*DBExecutor) GetConf

func (dbe *DBExecutor) GetConf() *config.Config

func (*DBExecutor) GetUserById

func (dbe *DBExecutor) GetUserById(tx *gorm.DB, userId string) (*User, error)

func (*DBExecutor) GetUserByName

func (dbe *DBExecutor) GetUserByName(tx *gorm.DB, userName string) (*User, error)

func (*DBExecutor) ListAccessKeys

func (dbe *DBExecutor) ListAccessKeys(
	db *gorm.DB, accessKeyIDs []string, owner string, limit int, offset int) (k []*AccessKey, err error)

func (*DBExecutor) ListUsers

func (dbe *DBExecutor) ListUsers(
	db *gorm.DB, user_ids []string, limit int, offset int) (u []*User, err error)

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) TableName

func (u User) TableName() string

func (*User) ToUserReply

func (u *User) ToUserReply() *pbmodel.User

Jump to

Keyboard shortcuts

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