Documentation
¶
Index ¶
- Variables
- func NewApplication(guard string) auth.Auth
- type Application
- func (app *Application) Guard(name string) auth.Auth
- func (app *Application) Login(user any) (token string, err error)
- func (app *Application) LoginUsingID(id any) (token string, err error)
- func (app *Application) Logout() error
- func (app *Application) Parse(token string) error
- func (app *Application) Refresh() (token string, err error)
- func (app *Application) User(user any) error
- type Claims
- type ServiceProvider
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorRefreshTimeExceeded = errors.New("refresh time exceeded") ErrorTokenExpired = errors.New("token expired") ErrorNoPrimaryKeyField = errors.New("the primaryKey field was not found in the model, set primaryKey like orm.Model") ErrorEmptySecret = errors.New("secret is required") ErrorTokenDisabled = errors.New("token is disabled") )
Functions ¶
func NewApplication ¶
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func (*Application) LoginUsingID ¶
func (app *Application) LoginUsingID(id any) (token string, err error)
func (*Application) Logout ¶
func (app *Application) Logout() error
func (*Application) Parse ¶
func (app *Application) Parse(token string) error
func (*Application) Refresh ¶
func (app *Application) Refresh() (token string, err error)
Refresh need parse token first.
func (*Application) User ¶
func (app *Application) User(user any) error
User need parse token first.
type Claims ¶
type Claims struct {
Key string `json:"key"`
jwt.RegisteredClaims
}
type ServiceProvider ¶
type ServiceProvider struct {
}
func (*ServiceProvider) Boot ¶
func (database *ServiceProvider) Boot()
func (*ServiceProvider) Register ¶
func (database *ServiceProvider) Register()
Click to show internal directories.
Click to hide internal directories.