mvc

package
v1.264.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: MIT Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller func(ctx context.Context) (View, Model)

Controller for mvc.

type Model added in v1.255.0

type Model any

Model for mvc.

type Patterns added in v1.257.0

type Patterns []string

Patterns to render views.

type Router added in v1.257.0

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

Router for mvc.

func NewRouter added in v1.257.0

func NewRouter(mux *http.ServeMux, views *Views) *Router

NewRouter for mvc.

func (*Router) Route added in v1.257.0

func (r *Router) Route(path string, controller Controller)

Route the path with controller for mvc.

type View

type View string

View to render.

type Views added in v1.257.0

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

View for mvc.

func NewViews added in v1.257.0

func NewViews(params ViewsParams) *Views

NewView from fs with patterns.

type ViewsParams added in v1.257.0

type ViewsParams struct {
	fx.In

	FS       *embed.FS `optional:"true"`
	Patterns Patterns  `optional:"true"`
}

ViewsParams for mvc.

Jump to

Keyboard shortcuts

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