v1

package
v0.0.0-...-9896131 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 200 ... 2xx
	Success = "success"

	// 400
	BadRequest    = "bad_request"
	WrongPassword = "wrong_password"

	// 401
	UnAuthorized        = "unauthorized"
	AccessTokenExpired  = "access_token_expired"
	RefreshTokenExpired = "refresh_token_expired"
	HeaderRequired      = "header_required" // this can be custom authorization headers like session, access key...

	// 403
	PermissionDenied = "permission_denied"

	// 404
	NotFound = "not_found"

	// 413
	SizeExceeded = "size_exceeded"

	// 500
	InternalServerError = "internal_server_error"
)

Variables

This section is empty.

Functions

func GetClaims

func GetClaims(h handlerV1, c *gin.Context) (*t.CustomClaims, error)

func New

func New(c *HandlerV1Config) *handlerV1

New ...

func ParseLimitQueryParam

func ParseLimitQueryParam(c *gin.Context) (int, error)

func ParsePageQueryParam

func ParsePageQueryParam(c *gin.Context) (int, error)

func StructToStruct

func StructToStruct(from, to any) error

Types

type HandlerV1Config

type HandlerV1Config struct {
	Logger     *logger.Logger
	Cfg        config.Config
	Postgres   storage.StorageI
	JWTHandler t.JWTHandler
	Redis      redisrepo.InMemoryStorageI
}

Jump to

Keyboard shortcuts

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