Documentation ¶
Index ¶
- Variables
- func GetAuth(guard string) auth.Auth
- func Logout(ctx *frame.Context)
- func NewJwt(guard string) authContract.Auth
- func NewSession(guard string, store *session.Store) auth.Auth
- type Application
- type Jwt
- func (app *Jwt) Data(ctx *frame.Context) (map[string]any, error)
- func (app *Jwt) Guard(name string) authContract.Auth
- func (app *Jwt) Login(ctx *frame.Context, user authContract.User, data ...map[string]any) (token *authContract.AccessToken, err error)
- func (app *Jwt) LoginUsingID(ctx *frame.Context, id any) (token *authContract.AccessToken, err error)
- func (app *Jwt) Logout(ctx *frame.Context) error
- func (app *Jwt) Parse(ctx *frame.Context, token string, user authContract.User) error
- func (app *Jwt) Refresh(ctx *frame.Context) (token *authContract.AccessToken, err error)
- func (app *Jwt) User(ctx *frame.Context, user authContract.User) error
- type ServiceProvider
- type Session
- func (app *Session) Data(ctx *frame.Context) (map[string]any, error)
- func (app *Session) Guard(name string) auth.Auth
- func (app *Session) Login(ctx *frame.Context, user auth.User, data ...map[string]any) (token *auth.AccessToken, err error)
- func (app *Session) LoginUsingID(ctx *frame.Context, id any) (token *auth.AccessToken, err error)
- func (app *Session) Logout(ctx *frame.Context) error
- func (app *Session) Parse(ctx *frame.Context, token string, user auth.User) error
- func (app *Session) Refresh(ctx *frame.Context) (token *auth.AccessToken, err error)
- func (app *Session) User(ctx *frame.Context, user auth.User) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorRefreshTimeExceeded = errors.New("refresh time exceeded") 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") ErrorParseTokenFirst = errors.New("parse token first") )
View Source
var Drivers *drivers
Functions ¶
func NewJwt ¶
func NewJwt(guard string) authContract.Auth
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
type Jwt ¶
type Jwt struct {
// contains filtered or unexported fields
}
func (*Jwt) Login ¶
func (app *Jwt) Login(ctx *frame.Context, user authContract.User, data ...map[string]any) (token *authContract.AccessToken, err error)
func (*Jwt) LoginUsingID ¶
func (app *Jwt) LoginUsingID(ctx *frame.Context, id any) (token *authContract.AccessToken, err error)
func (*Jwt) Refresh ¶
func (app *Jwt) Refresh(ctx *frame.Context) (token *authContract.AccessToken, err error)
Refresh need parse token first.
type ServiceProvider ¶
func (*ServiceProvider) Boot ¶
func (database *ServiceProvider) Boot()
func (*ServiceProvider) Register ¶
func (database *ServiceProvider) Register()
Click to show internal directories.
Click to hide internal directories.