Documentation ¶
Index ¶
- type Application
- func (a *Application) Create() (err error)
- func (a *Application) Delete() (err error)
- func (a *Application) FindByAccessToken(accessToken string) (err error)
- func (a *Application) FindByGuestAccessToken(guestAccessToken string) (err error)
- func (a *Application) FindByID(id uint) (err error)
- func (a *Application) Update() (err error)
- type Applications
- type Sound
- type Sounds
- type User
- func (u *User) Create() (err error)
- func (u *User) Delete() (err error)
- func (u *User) FindByID(id uint) (err error)
- func (u *User) FindByName(name string) (err error)
- func (u *User) FindByUID(uid string) (err error)
- func (u *User) GenerateAccessToken() (token string, err error)
- func (u *User) Update() (err error)
- type Users
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { gorm.Model Name string `json:"name" gorm:"unique;not null"` Password string `json:"-"` IsPassword bool `json:"isPassword"` User *User `json:"user"` UserID uint `json:"userId" gorm:"not null"` Description string `json:"description"` AccessToken string `json:"accessToken" gorm:"unique;not null"` GuestAccessToken string `json:"guestAccessToken" gorm:"unique;not null"` }
Application is struct of application
func (*Application) Create ¶
func (a *Application) Create() (err error)
Create creates an application
func (*Application) Delete ¶
func (a *Application) Delete() (err error)
Delete deletes an application
func (*Application) FindByAccessToken ¶
func (a *Application) FindByAccessToken(accessToken string) (err error)
FindByAccessToken finds an application by access token
func (*Application) FindByGuestAccessToken ¶
func (a *Application) FindByGuestAccessToken(guestAccessToken string) (err error)
FindByGuestAccessToken finds an application by guest access token
func (*Application) FindByID ¶
func (a *Application) FindByID(id uint) (err error)
FindByID finds an application by id
func (*Application) Update ¶
func (a *Application) Update() (err error)
Update updates an application
type Applications ¶
type Applications []Application
Applications is slice of applications
func (*Applications) FindByUserID ¶
func (as *Applications) FindByUserID(userID uint, offset, limit int) (err error)
FindByUserID finds applications by user id
func (*Applications) List ¶
func (as *Applications) List(offset, limit int) (err error)
List lists applications
func (*Applications) SearchByName ¶
func (as *Applications) SearchByName(name string, offset, limit int) (err error)
SearchByName searches applications by name
type Sound ¶
type Sound struct { gorm.Model Name string `json:"name" gorm:"unique;not null;index"` Path string `json:"path" gorm:"unique;not null"` NumCalls int `json:"numCalls" gorm:"default 0"` }
Sound is struct of Sound
func (*Sound) FindByName ¶
FindByName finds a sound by name
type User ¶
type User struct { gorm.Model UID string `json:"uid" gorm:"unique;not null"` Name string `json:"name" gorm:"unique;not null"` Applications []Application `json:"applications"` Description string `json:"description"` }
User is struct of user
func (*User) FindByName ¶
FindByName finds a user by name
func (*User) GenerateAccessToken ¶
GenerateAccessToken generates access token from user
Click to show internal directories.
Click to hide internal directories.