Documentation
¶
Index ¶
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 (
// NewrelicKey Context key
NewrelicKey = newrelicKey{}
)
View Source
var Translang = Trans{ Lang: ja.New(), RegisterDefaultTranslations: jaTranslations.RegisterDefaultTranslations, }
Functions ¶
func ChangeTranslate ¶
func ChangeTranslate()
func NewrelicMiddleware ¶
func NewrelicMiddleware(app newrelic.Application) interfaces.BdxHandlerFunc
NewrelicMiddleware newrelic monitoringツールを使用する際のミドルウェア
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.