Documentation
¶
Index ¶
- func Delete[Model any](path string, controller Controller[Model]) bool
- func Get[Model any](path string, controller Controller[Model]) bool
- func IsDefined() bool
- func NewFunctionMap(params FunctionMapParams) sprout.FunctionMap
- func NewViewPair(name string) (*View, *View)
- func Patch[Model any](path string, controller Controller[Model]) bool
- func Post[Model any](path string, controller Controller[Model]) bool
- func Put[Model any](path string, controller Controller[Model]) bool
- func Register(params RegisterParams)
- func Route[Model any](path string, controller Controller[Model]) bool
- func StaticFile(path, name string) bool
- func StaticPathValue(path, 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 ¶ added in v1.564.0
func Delete[Model any](path string, controller Controller[Model]) bool
Delete method for mvc.
func Get ¶ added in v1.564.0
func Get[Model any](path string, controller Controller[Model]) bool
Get method for mvc.
func NewFunctionMap ¶ added in v1.568.0
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 ¶ added in v1.565.0
NewViewPair returns a pair of full and partial view.
func Patch ¶ added in v1.564.0
func Patch[Model any](path string, controller Controller[Model]) bool
Patch method for mvc.
func Post ¶ added in v1.564.0
func Post[Model any](path string, controller Controller[Model]) bool
Post method for mvc.
func Put ¶ added in v1.564.0
func Put[Model any](path string, controller Controller[Model]) bool
Put method for mvc.
func Route ¶
func Route[Model any](path string, controller Controller[Model]) bool
Route the path with controller for mvc.
func StaticFile ¶ added in v1.559.0
StaticFile to be served via path.
func StaticPathValue ¶ added in v1.559.0
StaticPathValue to be served from a dedicated path value.
Types ¶
type Controller ¶
Controller for mvc.
type FunctionMapParams ¶ added in v1.588.0
type FunctionMapParams struct { fx.In Logger *slog.Logger Registries []sprout.Registry `optional:"true"` }
FunctionMapParams for sprout.
type Layout ¶ added in v1.562.0
type Layout struct {
// contains filtered or unexported fields
}
Layout is the main template that is used for all other templates.
func (*Layout) PartialName ¶ added in v1.563.0
PartialName of the layout.
type RegisterParams ¶ added in v1.562.0
type RegisterParams struct { fx.In Mux *http.ServeMux FunctionMap sprout.FunctionMap FileSystem fs.FS `optional:"true"` Layout *Layout `optional:"true"` }
RegisterParams for mvc.
type View ¶
type View struct {
// contains filtered or unexported fields
}
View to render.
func NewPartialView ¶ added in v1.563.0
NewPartialView to render.
Click to show internal directories.
Click to hide internal directories.