api

package
v0.0.0-...-c5fdaab Latest Latest
Warning

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

Go to latest
Published: May 7, 2020 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeQueryParams

func DecodeQueryParams(dst interface{}, ctx *clevergo.Context) (err error)

Types

type Application

type Application struct {
	*core.Application
}

Application API application.

func New

func New(
	logger log.Logger,
	params core.Params,
	db *sqlex.DB,
	sessionManager *scs.SessionManager,
	userManager *UserManager,
	mailer *mail.Dialer,
	accessManager *access.Manager,
) *Application

func NewApplication

func NewApplication(app *core.Application) *Application

NewApplication returns API application.

func (*Application) Error

func (app *Application) Error(ctx *clevergo.Context, err error) error

func (*Application) Success

func (app *Application) Success(ctx *clevergo.Context, data interface{}) error

type AuthzMiddleware

type AuthzMiddleware clevergo.MiddlewareFunc

func NewAuthzMiddleware

func NewAuthzMiddleware(enforcer *casbin.Enforcer, userManager *UserManager) AuthzMiddleware

type ErrorHandler

type ErrorHandler struct {
}

func NewErrorHandler

func NewErrorHandler() *ErrorHandler

func (*ErrorHandler) Handle

func (h *ErrorHandler) Handle(ctx *clevergo.Context, err error)

type QueryParams

type QueryParams struct {
	Sort      string `json:"sort"`
	Direction string `json:"direction"`
}

func (QueryParams) OrderBy

func (qp QueryParams) OrderBy() string

func (QueryParams) Validate

func (qp QueryParams) Validate() error

type UserManager

type UserManager struct {
	*users.Manager
}

func NewUserManager

func NewUserManager(identityStore auth.IdentityStore) *UserManager

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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