fastauth

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const SessionContextKey contextKey = "session"

Variables

This section is empty.

Functions

This section is empty.

Types

type CookieOptions

type CookieOptions struct {
	Name   string
	Path   string
	Secure bool
}

type FastAuth

type FastAuth struct {
	// contains filtered or unexported fields
}

func New

func New(options NewOptions) *FastAuth

func (*FastAuth) CreateCookie

func (e *FastAuth) CreateCookie(session auth.Session) (*fasthttp.Cookie, error)

func (*FastAuth) CreateNewSession

func (a *FastAuth) CreateNewSession(ctx *fasthttp.RequestCtx, newSession auth.Session) (auth.Session, error)

func (*FastAuth) GetSession

func (a *FastAuth) GetSession(ctx *fasthttp.RequestCtx) (auth.Session, error)

func (*FastAuth) GetSessionAndRefresh

func (e *FastAuth) GetSessionAndRefresh(ctx *fasthttp.RequestCtx, expiresAt time.Time) (auth.Session, error)

func (*FastAuth) InvalidateSession

func (e *FastAuth) InvalidateSession(ctx *fasthttp.RequestCtx) error

func (*FastAuth) Service

func (a *FastAuth) Service() *auth.SessionService

type NewOptions

type NewOptions struct {
	Adapter       auth.SessionAdapter
	Encrypter     auth.Encrypter
	Generator     auth.Generator
	CookieOptions CookieOptions
	Validate      Validate
}

type Validate

type Validate func(*fasthttp.RequestCtx, auth.Session) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL