Documentation
¶
Index ¶
- func CreateAdmin(d *Admin) error
- func CreateDeveloper(d *Developer) error
- func CreateUser(d *User) error
- func CreateUserBasicInfo(ubi *UserBasicInfo) error
- func DeleteUserBasicInfoByUsername(username string) error
- func InitDb(driverName, dataSourceName string) (err error)
- func IsErrNotExist(err error) bool
- type Admin
- type Admins
- type Api
- type ApiAuditWhitelist
- type ApiCookie
- type ApiGroup
- type ApiGroupWhitelist
- type ApiVersion
- type ApiVersionAppendixAudit
- type ApiWhitelist
- type AppCategory
- type Developer
- type Engine
- type ErrNotExist
- type GwConf
- type InnerApp
- type InnerUser
- type ListAdminsOption
- type ListDevelopersOption
- type ListUserBasicInfosOption
- type ListUsersOption
- type User
- type UserBasicInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAdmin ¶
func CreateDeveloper ¶
func CreateUser ¶
func CreateUserBasicInfo ¶
func CreateUserBasicInfo(ubi *UserBasicInfo) error
func IsErrNotExist ¶
IsErrNotExist checks if an error is a ErrNotExist.
Types ¶
type Admin ¶
type Admin struct {
Charactar int `xorm:"not null INT(8)"`
Deleted int `xorm:"not null default 0 TINYINT(8)"`
DeveloperId string `xorm:"not null unique(idx_admin_user_id_developer_id_group_id) CHAR(20)"`
GroupId int `xorm:"unique(idx_admin_user_id_developer_id_group_id) INT(10)"`
UserId int `xorm:"not null unique(idx_admin_user_id_developer_id_group_id) INT(20)"`
Developer *Developer `xorm:"-"`
User *User
}
func (*Admin) LoadDeveloper ¶
type Admins ¶
type Admins []*Admin
func ListAdmins ¶
func ListAdmins(opt ListAdminsOption) (Admins, error)
type ApiAuditWhitelist ¶
type ApiCookie ¶
type ApiCookie struct {
CookieName string `xorm:"not null default '' unique VARCHAR(32)"`
CreateTime int `xorm:"not null default 0 INT(10)"`
Description string `xorm:"not null default '' VARCHAR(512)"`
DeveloperId string `xorm:"not null CHAR(20)"`
Id int `xorm:"not null pk autoincr unique INT(10)"`
IsDeleted int `xorm:"not null default 0 TINYINT(8)"`
UpdateTime int `xorm:"not null default 0 INT(10)"`
}
type ApiGroupWhitelist ¶
type ApiVersion ¶
type ApiVersion struct {
Access int `xorm:"not null default 0 TINYINT(1)"`
ApiId int `xorm:"not null default 0 INT(10)"`
CacheExpires int `xorm:"not null default 0 INT(10)"`
ConnectTimeout int `xorm:"not null default 500 INT(10)"`
Cookies string `xorm:"not null default '' VARCHAR(264)"`
CreateTime int `xorm:"not null default 0 INT(10)"`
Creator string `xorm:"not null default '' VARCHAR(64)"`
DeleteCacheExpires int `xorm:"not null default 0 INT(11)"`
DeleteInputDoc string `xorm:"not null default '' VARCHAR(1024)"`
DeleteIsCheckApp int `xorm:"not null default 0 TINYINT(1)"`
DeleteIsCheckSession int `xorm:"not null default 0 TINYINT(1)"`
DeleteIsPrivate int `xorm:"not null default 0 TINYINT(1)"`
DeleteIsPublic int `xorm:"not null default 0 TINYINT(1)"`
DeleteIsToken int `xorm:"not null default 0 TINYINT(1)"`
DeleteOutputDoc string `xorm:"not null default '' VARCHAR(1024)"`
DeleteSessionParamMap string `xorm:"not null default '' VARCHAR(128)"`
DeleteSessionUrlMap string `xorm:"not null default '' VARCHAR(128)"`
DeleteTestInputDoc string `xorm:"not null default '' VARCHAR(64)"`
DeleteTestOutputDoc string `xorm:"not null default '' VARCHAR(64)"`
Depend string `xorm:"not null default '' VARCHAR(256)"`
Description string `xorm:"not null default '' VARCHAR(1024)"`
DetailLog int `xorm:"not null default 0 TINYINT(1)"`
GetCacheExpires int `xorm:"not null default 0 INT(10)"`
GetInputDoc string `xorm:"not null default '' VARCHAR(1024)"`
GetIsCheckApp int `xorm:"not null default 0 TINYINT(1)"`
GetIsCheckSession int `xorm:"not null default 0 TINYINT(1)"`
GetIsPrivate int `xorm:"not null default 0 TINYINT(1)"`
GetIsPublic int `xorm:"not null default 0 TINYINT(1)"`
GetIsToken int `xorm:"not null default 0 TINYINT(1)"`
GetOutputDoc string `xorm:"TEXT"`
GetSessionParamMap string `xorm:"not null default '' VARCHAR(128)"`
GetSessionUrlMap string `xorm:"not null default '' VARCHAR(128)"`
GetTestInputDoc string `xorm:"not null default '' VARCHAR(1024)"`
GetTestOutputDoc string `xorm:"TEXT"`
Id int `xorm:"not null pk autoincr INT(10)"`
IsAudit int `xorm:"not null default 0 TINYINT(1)"`
IsDelete int `xorm:"not null default 0 TINYINT(1)"`
IsDeleted int `xorm:"not null default 0 TINYINT(1)"`
IsGet int `xorm:"not null default 0 TINYINT(1)"`
IsPatch int `xorm:"not null default 0 TINYINT(1)"`
IsPost int `xorm:"not null default 0 TINYINT(1)"`
IsPut int `xorm:"not null default 0 TINYINT(1)"`
MaxPerMinute int `xorm:"not null default 0 INT(10)"`
Modifier string `xorm:"not null default '' VARCHAR(512)"`
OuterUrl string `xorm:"VARCHAR(128)"`
PatchCacheExpires int `xorm:"not null default 0 INT(11)"`
PatchInputDoc string `xorm:"TEXT"`
PatchIsCheckApp int `xorm:"not null default 0 TINYINT(1)"`
PatchIsCheckSession int `xorm:"not null default 0 TINYINT(1)"`
PatchIsPrivate int `xorm:"not null default 0 TINYINT(1)"`
PatchIsPublic int `xorm:"not null default 0 TINYINT(1)"`
PatchIsToken int `xorm:"not null default 0 TINYINT(1)"`
PatchOutputDoc string `xorm:"TEXT"`
PatchSessionParamMap string `xorm:"not null default '' VARCHAR(128)"`
PatchSessionUrlMap string `xorm:"not null default '' VARCHAR(128)"`
PatchTestInputDoc string `xorm:"not null default '' VARCHAR(64)"`
PatchTestOutputDoc string `xorm:"not null default '' VARCHAR(64)"`
PostCacheExpires int `xorm:"not null default 0 INT(11)"`
PostInputDoc string `xorm:"TEXT"`
PostIsCheckApp int `xorm:"not null default 0 TINYINT(1)"`
PostIsCheckSession int `xorm:"not null default 0 TINYINT(1)"`
PostIsPrivate int `xorm:"not null default 0 TINYINT(1)"`
PostIsPublic int `xorm:"not null default 0 TINYINT(1)"`
PostIsToken int `xorm:"not null default 0 TINYINT(1)"`
PostOutputDoc string `xorm:"TEXT"`
PostSessionParamMap string `xorm:"not null default '' VARCHAR(128)"`
PostSessionUrlMap string `xorm:"not null default '' VARCHAR(128)"`
PostTestInputDoc string `xorm:"TEXT"`
PostTestOutputDoc string `xorm:"TEXT"`
PreLambda string `xorm:"not null TEXT"`
PreUrl string `xorm:"not null default '' VARCHAR(128)"`
ProductLambda string `xorm:"not null TEXT"`
ProductUrl string `xorm:"not null default '' VARCHAR(128)"`
ProviderType int `xorm:"not null default 0 TINYINT(1)"`
PutCacheExpires int `xorm:"not null default 0 INT(11)"`
PutInputDoc string `xorm:"TEXT"`
PutIsCheckApp int `xorm:"not null default 0 TINYINT(1)"`
PutIsCheckSession int `xorm:"not null default 0 TINYINT(1)"`
PutIsPrivate int `xorm:"not null default 0 TINYINT(1)"`
PutIsPublic int `xorm:"not null default 0 TINYINT(1)"`
PutIsToken int `xorm:"not null default 0 TINYINT(1)"`
PutOutputDoc string `xorm:"TEXT"`
PutSessionParamMap string `xorm:"not null default '' VARCHAR(128)"`
PutSessionUrlMap string `xorm:"not null default '' VARCHAR(128)"`
PutTestInputDoc string `xorm:"not null default '' VARCHAR(64)"`
PutTestOutputDoc string `xorm:"not null default '' VARCHAR(64)"`
RequestTimeout int `xorm:"not null default 0 INT(10)"`
SandboxLambda string `xorm:"not null TEXT"`
SandboxUrl string `xorm:"not null default '' VARCHAR(128)"`
Status int `xorm:"not null default 0 TINYINT(1)"`
TestInput string `xorm:"not null default '' VARCHAR(1024)"`
TestLambda string `xorm:"not null TEXT"`
TestOutput string `xorm:"not null default '' VARCHAR(1024)"`
TestUrl string `xorm:"not null default '' VARCHAR(128)"`
Timeout int `xorm:"not null default 0 INT(10)"`
Token string `xorm:"not null default '' VARCHAR(32)"`
UpdateTime int `xorm:"not null default 0 INT(10)"`
Version string `xorm:"not null default '' VARCHAR(16)"`
}
type ApiVersionAppendixAudit ¶
type ApiVersionAppendixAudit struct {
AuditComment string `xorm:"not null default '' VARCHAR(4096)"`
Auditor string `xorm:"not null default '' VARCHAR(512)"`
CreateTime int `xorm:"not null default 0 INT(10)"`
Id int `xorm:"not null pk unique INT(10)"`
IsDeleted int `xorm:"not null default 0 TINYINT(8)"`
UpdateTime int `xorm:"not null default 0 INT(10)"`
}
type ApiWhitelist ¶
type AppCategory ¶
type Developer ¶
type Developer struct {
AccessKey string `xorm:"not null default '' VARCHAR(32)"`
DeveloperId string `xorm:"CHAR(20)"`
DeveloperName string `xorm:"VARCHAR(64)"`
DeveloperType string `xorm:"CHAR(8)"`
Id int `xorm:"not null pk autoincr INT(12)"`
}
func ListDevelopers ¶
func ListDevelopers(opt ListDevelopersOption) ([]*Developer, error)
type Engine ¶
type Engine interface {
Table(tableNameOrBean interface{}) *xorm.Session
Count(...interface{}) (int64, error)
Decr(column string, arg ...interface{}) *xorm.Session
Delete(interface{}) (int64, error)
Exec(...interface{}) (sql.Result, error)
Find(interface{}, ...interface{}) error
Get(interface{}) (bool, error)
ID(interface{}) *xorm.Session
In(string, ...interface{}) *xorm.Session
Incr(column string, arg ...interface{}) *xorm.Session
Insert(...interface{}) (int64, error)
InsertOne(interface{}) (int64, error)
Iterate(interface{}, xorm.IterFunc) error
Join(joinOperator string, tablename interface{}, condition string, args ...interface{}) *xorm.Session
SQL(interface{}, ...interface{}) *xorm.Session
Where(interface{}, ...interface{}) *xorm.Session
Asc(colNames ...string) *xorm.Session
}
Engine represents a XORM engine or session.
type ErrNotExist ¶
type ErrNotExist struct {
Key interface{}
}
ErrNotExist represents a "ErrNotExist" kind of error.
func (ErrNotExist) Error ¶
func (err ErrNotExist) Error() string
type InnerApp ¶
type InnerApp struct {
Id int `xorm:"not null pk autoincr INT(10)"`
Name string `xorm:"not null default '' VARCHAR(16)"`
PreKey string `xorm:"not null default '' VARCHAR(32)"`
PreSecret string `xorm:"not null default '' VARCHAR(32)"`
ProductKey string `xorm:"not null default '' VARCHAR(32)"`
ProductSecret string `xorm:"not null default '' VARCHAR(32)"`
SandboxKey string `xorm:"not null default '' VARCHAR(32)"`
SandboxSecret string `xorm:"not null default '' VARCHAR(32)"`
TestKey string `xorm:"not null default '' VARCHAR(32)"`
TestSecret string `xorm:"not null default '' VARCHAR(32)"`
}
type ListAdminsOption ¶
type ListAdminsOption struct {
// contains filtered or unexported fields
}
func (ListAdminsOption) WithDeveloperId ¶
func (opt ListAdminsOption) WithDeveloperId(developerId int) ListAdminsOption
func (ListAdminsOption) WithUserId ¶
func (opt ListAdminsOption) WithUserId(userId int) ListAdminsOption
type ListDevelopersOption ¶
type ListDevelopersOption struct{}
type ListUserBasicInfosOption ¶
type ListUserBasicInfosOption struct{}
type ListUsersOption ¶
type ListUsersOption struct {
// contains filtered or unexported fields
}
func (ListUsersOption) WithDeveloperId ¶
func (opt ListUsersOption) WithDeveloperId(developerId string) ListUsersOption
func (ListUsersOption) WithRtx ¶
func (opt ListUsersOption) WithRtx(rtx string) ListUsersOption
type User ¶
type User struct {
Deleted int `xorm:"not null default 0 TINYINT(8)" json:"-"`
DeveloperId string `xorm:"CHAR(20)" json:"developer_id"`
LastLoginTime time.Time `xorm:"DATETIME" json:"-"`
Rtx string `xorm:"unique CHAR(32)" json:"rtx"`
UserId int `xorm:"not null pk autoincr INT(20)" json:"user_id"`
Developer *Developer `xorm:"-" json:"-"`
UserBasicInfo *UserBasicInfo `xorm:"-" json:"-"`
}
func GetUserByRtx ¶
func GetUserByUserId ¶
func ListUsers ¶
func ListUsers(opt ListUsersOption) ([]*User, error)
func (*User) LoadDeveloper ¶
func (*User) LoadUserBasicInfo ¶
type UserBasicInfo ¶
type UserBasicInfo struct {
CreateTime int `xorm:"not null default 0 INT(10)"`
Description string `xorm:"not null default '' VARCHAR(1024)"`
DeveloperId string `xorm:"not null default '' unique(idx_user_list_username_developer_id) CHAR(20)"`
Email string `xorm:"not null default '' VARCHAR(32)"`
Fullname string `xorm:"not null default '' VARCHAR(32)"`
IsDeleted int `xorm:"not null default 0 TINYINT(8)"`
Mobilephone string `xorm:"not null default '' VARCHAR(32)"`
Password string `xorm:"not null default '' VARCHAR(32)"`
Username string `xorm:"not null pk default '' unique unique(idx_user_list_username_developer_id) CHAR(32)"`
User *User
Developer *Developer `xorm:"-"`
}
func GetUserBasicInfoByDeveloperId ¶
func GetUserBasicInfoByDeveloperId(developerId string) (*UserBasicInfo, error)
func GetUserBasicInfoByUsername ¶
func GetUserBasicInfoByUsername(username string) (*UserBasicInfo, error)
func ListUserBasicInfos ¶
func ListUserBasicInfos(opt ListUserBasicInfosOption) ([]*UserBasicInfo, error)
func (*UserBasicInfo) LoadDeveloper ¶
func (ubi *UserBasicInfo) LoadDeveloper() error
func (*UserBasicInfo) LoadUser ¶
func (ubi *UserBasicInfo) LoadUser() error
Click to show internal directories.
Click to hide internal directories.