Documentation ¶
Index ¶
- Variables
- func Authentication(authenticator authnapi.Authenticator) func(middleware.Handler) middleware.Handler
- func GetFromContext[V any, I any](i I) func(context.Context) (*V, error)
- func Pagination(next http.Handler) http.Handler
- func Validation(validator *protovalidate.Validator) middleware.Middleware
- type PagedReponseMetadata
- type PagedResponse
- type PaginationRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var ( IdentityRequestKey = &contextKey{"authnapi.Identity"} GetIdentity = GetFromContext[authnapi.Identity](IdentityRequestKey) )
View Source
var ( PaginationRequestKey = &contextKey{"paginationRequest"} GetPaginationRequest = GetFromContext[PaginationRequest](PaginationRequestKey) )
View Source
var (
ErrWrongContext = errors.Unauthorized(reason, "Wrong context for middleware")
)
Functions ¶
func Authentication ¶
func Authentication(authenticator authnapi.Authenticator) func(middleware.Handler) middleware.Handler
func Validation ¶
func Validation(validator *protovalidate.Validator) middleware.Middleware
Types ¶
type PagedReponseMetadata ¶
type PagedResponse ¶
type PagedResponse[R any] struct { PagedReponseMetadata Items []R `json:"items"` }
Click to show internal directories.
Click to hide internal directories.