withmodel

package
v0.0.0-...-16952c6 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IDKey = IDType("modelID")
View Source
var ModelKey = ModelType("modelObject")

Functions

func GetID

func GetID(r *http.Request) models.ID

GetID returns the modelID. Panic indicates coding error.

func GetModelAny

func GetModelAny(r *http.Request) any

GetModelAny returns the model object as any. Panic indicates coding error.

func GetModelWithID

func GetModelWithID(r *http.Request) models.WithID

GetWithID returns the model object as a models.WithID instance. Panic indicates coding error.

func GetModelWithOrg

func GetModelWithOrg(r *http.Request) models.WithOrg

GetModelWithOrg returns the model object as a models.WithOrg instance. Panic indicates coding error.

func GetModelWithUser

func GetModelWithUser(r *http.Request) models.WithUser

GetModelWithUser returns the model object as a models.WithUser instance. Panic indicates coding error.

func Middleware

func Middleware(st *app.State, kind models.Kind) func(http.Handler) http.Handler

Middleware extracts the /{id} set in the router and turns it into a context variable of type models.ID.

Types

type IDType

type IDType string

type ModelType

type ModelType string

Jump to

Keyboard shortcuts

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