core

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeProd = "prod"
	ModeDev  = "dev"
)
View Source
const Version = "v0.3.0"

Variables

This section is empty.

Functions

func ErrorHandler

func ErrorHandler(next clevergo.Handle) clevergo.Handle

func IsDevelopMode

func IsDevelopMode() bool

Types

type Handler

type Handler struct {
	DB             *sqlx.DB
	SessionManager *scs.SessionManager
	Queue          *machinery.Server
	Cache          *ristretto.Cache
}

func NewHandler

func NewHandler(db *sqlx.DB, sessionManager *scs.SessionManager, queue *machinery.Server, cache *ristretto.Cache) Handler

func (Handler) AddAlert

func (h Handler) AddAlert(ctx context.Context, a alert.Alert)

func (Handler) AddErrorAlert

func (h Handler) AddErrorAlert(ctx context.Context, err error)

func (Handler) User added in v1.5.0

func (h Handler) User(ctx context.Context) *models.User

func (Handler) UserID

func (h Handler) UserID(ctx context.Context) int64

type SessionAuthenticator

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

func NewSessionAuthenticator

func NewSessionAuthenticator(sessionManager *scs.SessionManager) *SessionAuthenticator

func (*SessionAuthenticator) Authenticate

Authenticates the current user.

func (*SessionAuthenticator) Challenge

Challenge generates challenges upon authentication failure.

Jump to

Keyboard shortcuts

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