mvc

package
v0.0.1-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadView

func LoadView(w http.ResponseWriter, filename string, Data map[interface{}]interface{}, DataFuncMap template.FuncMap, Layouts map[string]string, ViewsDir string)

func Route

func Route(controllerFace ControllerInterface, controllerMethod string) func(net.Yttp)

Types

type Controller

type Controller struct {
	Echo []string
	Data map[interface{}]interface{}

	net.Yttp

	Funcs map[string]any

	Writer  http.ResponseWriter
	Request *http.Request

	/* Route data */
	RouteData map[string]string

	View    string
	Layouts map[string]string
}

func (*Controller) Construct

func (c *Controller) Construct()

Construct just define method

func (*Controller) Init

func (c *Controller) Init(y net.Yttp) *Controller

Init generates default values of controller operations.

type ControllerInterface

type ControllerInterface interface {
	Init(net.Yttp) *Controller
	Construct()
}

type HandlerFunc

type HandlerFunc func()

type Model

type Model struct{}

func (*Model) JSON

func (c *Model) JSON(anything any) string

Jump to

Keyboard shortcuts

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