web

package
v0.1.1-0...-f9b01a3 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(settings RouterSetting) (model.Router, error)

NewRouter creates and inits root http router.

Types

type Router

type Router struct {
	APIRouter        model.Router
	WebRouter        model.Router
	AdminRouter      model.Router
	AdminPanelRouter model.Router
	RootRouter       *http.ServeMux

	APIRouterPath        string
	WebRouterPath        string
	AdminRouterPath      string
	AdminPanelRouterPath string
}

Router is a root router to handle REST API, web, and admin requests.

func (*Router) ServeHTTP

func (ar *Router) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements identifo.Router interface.

type RouterSetting

type RouterSetting struct {
	AppStorage              model.AppStorage
	UserStorage             model.UserStorage
	TokenStorage            model.TokenStorage
	TokenBlacklist          model.TokenBlacklist
	VerificationCodeStorage model.VerificationCodeStorage
	TokenService            jwtService.TokenService
	SMSService              model.SMSService
	EmailService            model.EmailService
	SessionService          model.SessionService
	SessionStorage          model.SessionStorage
	StaticFilesStorage      model.StaticFilesStorage
	ConfigurationStorage    model.ConfigurationStorage
	Logger                  *log.Logger
	ServeAdminPanel         bool
	APIRouterSettings       []func(*api.Router) error
	WebRouterSettings       []func(*html.Router) error
	AdminRouterSettings     []func(*admin.Router) error
}

RouterSetting contains settings for root http router.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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