Documentation ¶
Index ¶
- func AddDeveloper(d *Developer) error
- func DeleteDeveloperByName(devname string) error
- func InitMysql(user, pwd, addr, db string) error
- func InitUserCache(limits int)
- func IsExist(path string) bool
- func UpdateDeveloper(p *Developer) error
- type AppInfo
- func (this *AppInfo) AddAndUpdateUser(user *User) error
- func (this *AppInfo) AddUser(user *User) error
- func (this *AppInfo) DeleteUser(userid, token string) error
- func (this *AppInfo) GetAllUsers() (users []*User, count int64, err error)
- func (this *AppInfo) GetUserById(userid, token string) (*User, error)
- func (this *AppInfo) GetUserByIdForTrain(userid, token string) (*User, error)
- func (this *AppInfo) NewUser(token, userid string) *User
- func (this *AppInfo) UpdateUser(u *User) error
- type CacheMem
- type DBEngine
- func (this *DBEngine) AddAppInfo(devname, appName string) error
- func (this *DBEngine) AddDeveloper(devname, password, email string) error
- func (this *DBEngine) AddUser(token, id string) error
- func (this *DBEngine) AddWavesAndContents(token, id string, wave []byte, content string, step int) error
- func (this *DBEngine) CheckDeveloper(devname, password string) (bool, error)
- func (this *DBEngine) CheckEmailIsExist(email string) bool
- func (this *DBEngine) ClearWavesAndContents(token, id string) error
- func (this *DBEngine) DeleteAppInfoByName(devname, appname string) error
- func (this *DBEngine) DeleteDeveloperByName(devname string) error
- func (this *DBEngine) DeleteUser(token, id string) error
- func (this *DBEngine) FindDeveloperByName(devname string) (*Developer, error)
- func (this *DBEngine) GetAppInfoByName(devname, appname string) (*AppInfo, error)
- func (this *DBEngine) GetAppInfoByToken(devname, token string) (*AppInfo, error)
- func (this *DBEngine) GetUserById(token, id string) (*User, error)
- func (this *DBEngine) GetUserByIdForTrain(token, id string) (*User, error)
- func (this *DBEngine) HasPermissionForAppInfo(devname, appid, appkey string) (bool, *AppInfo, error)
- func (this *DBEngine) UpdateAppInfoByName(devname string, app *AppInfo) error
- func (this *DBEngine) UpdateDeveloperByName(dev *Developer) error
- func (this *DBEngine) UpdateDeveloperPassword(devname, oldPassword, newPassword string) (bool, error)
- func (this *DBEngine) UpdateIsTrained(token, id string, isTrain bool) error
- type Developer
- func (this *Developer) AddAppInfo(app *AppInfo) error
- func (this *Developer) DeleteAppInfo(appname string) error
- func (this *Developer) GetAllAppInfo() (appInfos []*AppInfo, count int64, err error)
- func (this *Developer) GetAppInfoById(id int64) (*AppInfo, error)
- func (this *Developer) GetAppInfoByName(appname string) (*AppInfo, error)
- func (this *Developer) GetAppInfoByToken(token string) (*AppInfo, error)
- func (this *Developer) NewAppInfo(appname string) *AppInfo
- func (this *Developer) UpdateAppInfo(app *AppInfo) error
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDeveloper ¶
func DeleteDeveloperByName ¶
func InitUserCache ¶
func InitUserCache(limits int)
func UpdateDeveloper ¶
Types ¶
type AppInfo ¶
type AppInfo struct { Id int64 // Id号 AppId string `orm:"unique;size(50)"` //appid Key string `orm:"size(50)"` //秘钥 Name string `orm:"unique;size(32)"` //app名字 Developer *Developer `orm:"rel(fk)"` //应用所属的开发者 Created time.Time `orm:"auto_now_add;type(date)"` //应用创建时间 Email string `orm:"size(100)"` //与应用绑定的Email Token string `orm:"size(100)"` // app授权token值 Users []*User `orm:"reverse(many)"` // contains filtered or unexported fields }
AppInfo 应用信息
func GetAppInfoByToken ¶
func (*AppInfo) AddAndUpdateUser ¶
func (*AppInfo) DeleteUser ¶
func (*AppInfo) GetAllUsers ¶
func (*AppInfo) GetUserByIdForTrain ¶
func (*AppInfo) UpdateUser ¶
type CacheMem ¶
var UserCache *CacheMem
func NewCacheMem ¶
func (*CacheMem) RemoveOldest ¶
func (c *CacheMem) RemoveOldest()
RemoveOldest removes the oldest item from the keywordCache.
type DBEngine ¶
type DBEngine struct { }
func NewDBEngine ¶
func NewDBEngine() *DBEngine
func (*DBEngine) AddAppInfo ¶
func (*DBEngine) AddDeveloper ¶
func (*DBEngine) AddWavesAndContents ¶
func (*DBEngine) CheckDeveloper ¶
func (*DBEngine) CheckEmailIsExist ¶
func (*DBEngine) ClearWavesAndContents ¶
func (*DBEngine) DeleteAppInfoByName ¶
func (*DBEngine) DeleteDeveloperByName ¶
func (*DBEngine) DeleteUser ¶
func (*DBEngine) FindDeveloperByName ¶
func (*DBEngine) GetAppInfoByName ¶
func (*DBEngine) GetAppInfoByToken ¶
func (*DBEngine) GetUserByIdForTrain ¶
func (*DBEngine) HasPermissionForAppInfo ¶
func (*DBEngine) UpdateAppInfoByName ¶
func (*DBEngine) UpdateDeveloperByName ¶
func (*DBEngine) UpdateDeveloperPassword ¶
type Developer ¶
type Developer struct { Id int64 DeveloperName string `orm:"unique;size(32)"` Password string `orm:"size(50)"` Email string `orm:"size(50)"` CreateTime time.Time `orm:"auto_now_add;type(date)"` Apps []*AppInfo `orm:"reverse(many)"` // contains filtered or unexported fields }
func GetAllDevelopers ¶
func GetDeveloperByName ¶
func NewDeveloper ¶
func (*Developer) AddAppInfo ¶
func (*Developer) DeleteAppInfo ¶
func (*Developer) GetAllAppInfo ¶
获得所有项目
func (*Developer) GetAppInfoById ¶
获得项目
func (*Developer) GetAppInfoByName ¶
获得项目
func (*Developer) GetAppInfoByToken ¶
func (*Developer) NewAppInfo ¶
func (*Developer) UpdateAppInfo ¶
type User ¶
type User struct { Id int64 App *AppInfo `orm:"rel(fk)"` UserId string `orm:"unique;size(32)"` // 用户ID号 Token string `orm:"size(100)"` // app授权token值 Waves [][]byte `orm:"-"` Contents []string `orm:"-"` // 5条语音的文本内容 IsTrain bool // 是否已经训练模型 // contains filtered or unexported fields }
func (*User) GetAllWavesAndContents ¶
Click to show internal directories.
Click to hide internal directories.