Documentation ¶
Index ¶
- Constants
- Variables
- func CORS(ctx interfaces.Context)
- func ChangeTranslate()
- func Logger(ctx interfaces.Context)
- func NewrelicMiddleware() interfaces.BdxHandlerFunc
- func RoleCheck(headerKey string, roles []string) func(c interfaces.Context)
- func Validator(x interface{}) interfaces.BdxHandlerFunc
- type MIMEType
- type Trans
Constants ¶
View Source
const ( MIMEJSON = "application/json" MIMEHTML = "text/html" MIMEXML = "application/xml" MIMEXML2 = "text/xml" MIMEPlain = "text/plain" MIMEPOSTForm = "application/x-www-form-urlencoded" MIMEMultipartPOSTForm = "multipart/form-data" MIMEPROTOBUF = "application/x-protobuf" MIMEYAML = "application/x-yaml" )
Content-Type MIME of the most common data formats.
Variables ¶
View Source
var Translang = Trans{ Lang: ja.New(), RegisterDefaultTranslations: jaTranslations.RegisterDefaultTranslations, }
Functions ¶
func ChangeTranslate ¶
func ChangeTranslate()
func NewrelicMiddleware ¶
func NewrelicMiddleware() interfaces.BdxHandlerFunc
NewrelicMiddleware newrelic monitoringツールを使用する際のミドルウェア
func RoleCheck ¶ added in v0.0.3
func RoleCheck(headerKey string, roles []string) func(c interfaces.Context)
RoleCheck ロール確認ミドルウェア
func Validator ¶
func Validator(x interface{}) interfaces.BdxHandlerFunc
Validator は`Request.Body`にセットされている`JSON文字列`を`x`の引数の型に変換し、
`go-playground.Validator`でバリデーション処理を行うミドルウェア
エラーが発生した際はエラーレスポンスへ変換して後続のミドルウェア、ハンドルを実行しない
Types ¶
type Trans ¶
type Trans struct { Lang locales.Translator RegisterDefaultTranslations func(*validator.Validate, ut.Translator) error }
Click to show internal directories.
Click to hide internal directories.