middlewares

package
v0.0.0-...-a9081ec Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package middlewares provide a middleware used in handlers for RESTful HTTP requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthAdmin

func AuthAdmin(logger *otelzap.Logger, tracer trace.Tracer, s tokenservice.Interface) gin.HandlerFunc

AuthAdmin middleware check if the admin token is valid

func AuthStudent

func AuthStudent(logger *otelzap.Logger, tracer trace.Tracer, s tokenservice.Interface) gin.HandlerFunc

AuthStudent middleware check if the student token is valid

func Paginate

func Paginate(logger *otelzap.Logger) gin.HandlerFunc

Paginate middleware

Types

type QueryPage

type QueryPage struct {
	Page  int `form:"page"`
	Limit int `form:"limit"`
}

QueryPage contains bound and validated data.

Jump to

Keyboard shortcuts

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