controller

package
v0.0.0-...-26ab6e5 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTP

type HTTP interface {
	// SetRoutes allocates routes into the given echo.Echo instance.
	SetRoutes(e *echo.Echo)
}

HTTP is the interface for controllers based on the HTTP protocol.

type VersionedHTTP

type VersionedHTTP interface {
	HTTP
	// SetVersionedRoutes registers routes in paths with a versioning prefix (e.g., /v1/foo, /v10/bar)
	SetVersionedRoutes(g *echo.Group)
}

VersionedHTTP is an extension of HTTP interface. It allows controllers to register routes in paths with a versioning prefix (e.g., /v1/foo, /v10/bar).

type ViewData

type ViewData struct {
	Data map[string]any `json:"data"`
}

ViewData is a general-purposed container for views to wrap themselves in a data field.

Useful in HTTP APIs for response standardization.

func NewViewData

func NewViewData[T any](data any) ViewData

NewViewData allocates a new ViewData instance. Uses T's type name as the key of the single entry for ViewData.Data map.

Jump to

Keyboard shortcuts

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