cbweb

package module
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2020 License: MIT Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HtmlMiddleware

func HtmlMiddleware(ctx *fasthttp.RequestCtx) (bool, error)

Types

type DefaultErrorHandler added in v0.0.2

type DefaultErrorHandler struct{}

func (DefaultErrorHandler) Error added in v0.0.2

func (d DefaultErrorHandler) Error(e error)

func (DefaultErrorHandler) Recover added in v0.1.0

func (d DefaultErrorHandler) Recover()

type Dependencies added in v0.1.0

type Dependencies struct {
	Port         string
	ErrorHandler ErrorHandler
}

type ErrorHandler added in v0.0.2

type ErrorHandler interface {
	Error(e error)
	Recover()
}

type MasterViewModel

type MasterViewModel interface {
	GetViewIncludes() []ViewInclude
	GetTitle() string
	GetPageTitle() string
}

todo nav generation

type MasterViewModelTypeHinting

type MasterViewModelTypeHinting struct{}

This is here purely for typehinting in go template files

func (MasterViewModelTypeHinting) GetPageTitle added in v0.4.0

func (m MasterViewModelTypeHinting) GetPageTitle() string

func (MasterViewModelTypeHinting) GetTitle

func (m MasterViewModelTypeHinting) GetTitle() string

func (MasterViewModelTypeHinting) GetViewIncludes

func (m MasterViewModelTypeHinting) GetViewIncludes() []ViewInclude

type MiddlewareHandler

type MiddlewareHandler struct {
	ErrorHandler ErrorHandler
	Limiter      *config.Limiter
	// contains filtered or unexported fields
}

func (MiddlewareHandler) AddMiddleware

func (m MiddlewareHandler) AddMiddleware(middleware ...func(ctx *fasthttp.RequestCtx) (bool, error)) MiddlewareHandler

func (MiddlewareHandler) Handle

func (m MiddlewareHandler) Handle(ctx *fasthttp.RequestCtx)

func (MiddlewareHandler) HandleLimited added in v0.3.0

func (m MiddlewareHandler) HandleLimited() fasthttp.RequestHandler

func (MiddlewareHandler) SetAfterFinal added in v0.1.0

func (m MiddlewareHandler) SetAfterFinal(after ...func(ctx *fasthttp.RequestCtx) (bool, error)) MiddlewareHandler

func (MiddlewareHandler) SetFinal

func (m MiddlewareHandler) SetFinal(final func(ctx *fasthttp.RequestCtx)) MiddlewareHandler

func (MiddlewareHandler) SetProfiler added in v0.1.0

func (m MiddlewareHandler) SetProfiler(profiler Profiler) MiddlewareHandler

type Module

type Module interface {
	SetRoutes(router *router.Router)
	GetGlobalTemplates() map[string][]byte
	SetGlobalTemplates(templates map[string][]byte)
}

type Profiler added in v0.1.0

type Profiler interface {
	Start()
	End()
}

type Server

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

func NewServer

func NewServer(dependencies Dependencies, modules ...Module) *Server

func (*Server) AddModule

func (s *Server) AddModule(module Module)

func (*Server) Start

func (s *Server) Start() error

type ViewInclude

type ViewInclude struct {
	Type      ViewIncludeType
	Src       template.URL
	Html      template.HTML
	Attribute template.HTMLAttr
	Js        template.JS
	Css       template.CSS
}

type ViewIncludeType

type ViewIncludeType string
var (
	ViewIncludeType_JsHead           ViewIncludeType = "js-head"
	ViewIncludeType_JsHeadInline     ViewIncludeType = "js-head-inline"
	ViewIncludeType_CssHead          ViewIncludeType = "css-head"
	ViewIncludeType_CssHeadInline    ViewIncludeType = "css-head-inline"
	ViewIncludeType_JsBody           ViewIncludeType = "js-body"
	ViewIncludeType_JsBodyInline     ViewIncludeType = "js-body-inline"
	ViewIncludeType_CssBody          ViewIncludeType = "css-body"
	ViewIncludeType_CssBodyInline    ViewIncludeType = "css-body-inline"
	ViewIncludeType_JsPostBody       ViewIncludeType = "js-postBody"
	ViewIncludeType_JsPostBodyInline ViewIncludeType = "js-postBody-inline"
)

func (ViewIncludeType) IsCssBody

func (h ViewIncludeType) IsCssBody() bool

func (ViewIncludeType) IsCssBodyInline

func (h ViewIncludeType) IsCssBodyInline() bool

func (ViewIncludeType) IsCssHead

func (h ViewIncludeType) IsCssHead() bool

func (ViewIncludeType) IsCssHeadInline

func (h ViewIncludeType) IsCssHeadInline() bool

func (ViewIncludeType) IsJsBody

func (h ViewIncludeType) IsJsBody() bool

func (ViewIncludeType) IsJsBodyInline

func (h ViewIncludeType) IsJsBodyInline() bool

func (ViewIncludeType) IsJsHead

func (h ViewIncludeType) IsJsHead() bool

func (ViewIncludeType) IsJsHeadInline

func (h ViewIncludeType) IsJsHeadInline() bool

func (ViewIncludeType) IsJsPostBody

func (h ViewIncludeType) IsJsPostBody() bool

func (ViewIncludeType) IsJsPostBodyInline

func (h ViewIncludeType) IsJsPostBodyInline() bool

Directories

Path Synopsis
module

Jump to

Keyboard shortcuts

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