Documentation ¶
Index ¶
- type Model
- type PersonalAccessToken
- func (_ PersonalAccessToken) CreateTokenForUser(user User, name string, permanent bool) (PersonalAccessTokenResponse, error)
- func (_ PersonalAccessToken) Find(token string) PersonalAccessTokenResponse
- func (pat PersonalAccessToken) Logout() error
- func (_ PersonalAccessToken) RevokeToken(token string) error
- type PersonalAccessTokenResponse
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct { Name string Model interface{} Seeder *database.SeederDefinition }
func RegisteredModels ¶
func RegisteredModels() []Model
type PersonalAccessToken ¶
type PersonalAccessToken struct { gorm.Model UserID uint `gorm:"not null"` User User `gorm:"foreignKey:UserID;not null"` Name string `gorm:"not null" json:"name"` Token string `gorm:"not null" json:"token"` ExpiresAt time.Time `gorm:"not null" json:"expires_at"` }
func (PersonalAccessToken) CreateTokenForUser ¶
func (_ PersonalAccessToken) CreateTokenForUser(user User, name string, permanent bool) (PersonalAccessTokenResponse, error)
func (PersonalAccessToken) Find ¶
func (_ PersonalAccessToken) Find(token string) PersonalAccessTokenResponse
func (PersonalAccessToken) Logout ¶
func (pat PersonalAccessToken) Logout() error
func (PersonalAccessToken) RevokeToken ¶
func (_ PersonalAccessToken) RevokeToken(token string) error
type User ¶
type User struct { gorm.Model PersonalAccessToken []PersonalAccessToken `gorm:"foreignKey:UserID"` Name string `gorm:"not null"` Email string `gorm:"unique"` Password string `json:"-"` }
func (User) LoggedInAccessToken ¶
func (User) LoggedInUser ¶
func (User) Register ¶
func (u User) Register() (*PersonalAccessTokenResponse, error)
Click to show internal directories.
Click to hide internal directories.