util

package
v0.0.0-...-7efc56f Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorHandling

func ErrorHandling(ctx *gin.Context, err error)

func HealthCheck

func HealthCheck(ctx *gin.Context)

func IsNotFound

func IsNotFound(err error) bool

func SetMetadata

func SetMetadata(ctx *gin.Context) context.Context

func SetRequestID

func SetRequestID() gin.HandlerFunc

Types

type Authenticator

type Authenticator interface {
	Authentication() gin.HandlerFunc
	Authorization() gin.HandlerFunc
	HasAdminRole() gin.HandlerFunc
}

func NewAuthenticator

func NewAuthenticator(fa *authentication.Auth) Authenticator

type ErrorResponse

type ErrorResponse struct {
	StatusCode int                 `json:"status"`  // ステータスコード
	ErrorCode  exception.ErrorCode `json:"code"`    // エラーコード
	Message    string              `json:"message"` // エラー概要
	Detail     string              `json:"detail"`  // エラー詳細
}

ErrorResponse - エラーのレスポンス

Jump to

Keyboard shortcuts

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