Documentation
¶
Index ¶
- func Delete[Model any](pattern string, controller Controller[Model]) bool
- func Get[Model any](pattern string, controller Controller[Model]) bool
- func IsDefined() bool
- func NewFunctionMap(params FunctionMapParams) sprout.FunctionMap
- func NewViewPair(name string) (*View, *View)
- func Patch[Model any](pattern string, controller Controller[Model]) bool
- func Post[Model any](pattern string, controller Controller[Model]) bool
- func Put[Model any](pattern string, controller Controller[Model]) bool
- func Register(params RegisterParams)
- func Route[Model any](pattern string, controller Controller[Model]) bool
- func StaticFile(pattern, name string) bool
- func StaticPathValue(pattern, value, prefix string) bool
- type Controller
- type FunctionMapParams
- type Layout
- type RegisterParams
- type Template
- type View
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete[Model any](pattern string, controller Controller[Model]) bool
Delete method for mvc.
func Get ¶
func Get[Model any](pattern string, controller Controller[Model]) bool
Get method for mvc.
func NewFunctionMap ¶
func NewFunctionMap(params FunctionMapParams) sprout.FunctionMap
NewFunctionMap for sprout. List of registries can be found at https://docs.atom.codes/sprout/registries/list-of-all-registries
func NewViewPair ¶
NewViewPair returns a pair of full and partial view.
func Patch ¶
func Patch[Model any](pattern string, controller Controller[Model]) bool
Patch method for mvc.
func Post ¶
func Post[Model any](pattern string, controller Controller[Model]) bool
Post method for mvc.
func Put ¶
func Put[Model any](pattern string, controller Controller[Model]) bool
Put method for mvc.
func Route ¶
func Route[Model any](pattern string, controller Controller[Model]) bool
Route the path with controller for mvc.
func StaticPathValue ¶
StaticPathValue to be served from a dedicated path value.
Types ¶
type Controller ¶
Controller for mvc.
type FunctionMapParams ¶
type FunctionMapParams struct { di.In Logger *slog.Logger Registries []sprout.Registry `optional:"true"` }
FunctionMapParams for sprout.
type Layout ¶
type Layout struct {
// contains filtered or unexported fields
}
Layout is the main template that is used for all other templates.
type RegisterParams ¶
type RegisterParams struct { di.In Mux *http.ServeMux FunctionMap sprout.FunctionMap FileSystem fs.FS `optional:"true"` Layout *Layout `optional:"true"` }
RegisterParams for mvc.
Click to show internal directories.
Click to hide internal directories.