core

package
v0.0.0-...-51c09f1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetTemplateManager

func SetTemplateManager(tm *TemplateManager)

Types

type Controller

type Controller struct{}

func (*Controller) Render

func (c *Controller) Render(ctx *gin.Context, template string, data any)

func (*Controller) RenderStatus

func (c *Controller) RenderStatus(ctx *gin.Context, code int, template string, data any)

type ControllerConfig

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

func NewControllerConfig

func NewControllerConfig(controller ControllerInterface, options ...ControllerOption) *ControllerConfig

type ControllerGroup

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

func NewControllerGroup

func NewControllerGroup(controllers ...*ControllerConfig) *ControllerGroup

func (*ControllerGroup) AddController

func (cg *ControllerGroup) AddController(ctrl ControllerInterface, options ...ControllerOption) *ControllerGroup

func (*ControllerGroup) AddControllerConfig

func (cg *ControllerGroup) AddControllerConfig(config *ControllerConfig) *ControllerGroup

func (*ControllerGroup) RegisterRoutes

func (cg *ControllerGroup) RegisterRoutes(router gin.IRouter)

type ControllerInterface

type ControllerInterface interface {
	RegisterRoutes(router gin.IRouter)
}

type ControllerOption

type ControllerOption func(*ControllerConfig)

func WithMiddleWare

func WithMiddleWare(middleWare ...gin.HandlerFunc) ControllerOption

func WithRoutePrefix

func WithRoutePrefix(prefix string) ControllerOption

type TemplateManager

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

func GetTemplateManager

func GetTemplateManager() *TemplateManager

func NewTemplateManager

func NewTemplateManager(templateDir string) *TemplateManager

func (*TemplateManager) Add

func (tm *TemplateManager) Add(filename string) error

func (*TemplateManager) Get

func (t *TemplateManager) Get(name string) *template.Template

func (*TemplateManager) Load

func (tm *TemplateManager) Load() error

func (*TemplateManager) Templates

func (t *TemplateManager) Templates() map[string]*template.Template

Jump to

Keyboard shortcuts

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