Documentation ¶
Index ¶
Constants ¶
View Source
const ( RequiredTag = "required" EqFieldTag = "eqfield" MinTag = "min" MaxTag = "max" Base64Tag = "base64" EmailTag = "email" HiraganaTag = "hiragana" PasswordTag = "password" UniqueTag = "unique" LessThanTag = "lt" LessThanEqualTag = "lte" GreaterThanTag = "gt" GreaterThanEqualTag = "gte" OneOfTag = "oneof" )
バリデーションタグ
View Source
const ( RequiredMessage = "is required" EqFieldMessage = "does not match %s" MinMessage = "must be at least %s characters" MaxMessage = "must be at %s or less characters" Base64Message = "should be in base64 format" EmailMessage = "should be in email format" HiraganaMessage = "should be in hiragana format" PasswordMessage = "should be in password format" UniqueMessage = "must be unique" LessThanMessage = "must be at less than %s" LessThanEuqalMessage = "must be at less than or equal to %s" GreaterThanMessage = "must be at greater than %s" GreaterThanEqualMessage = "must be at greater than or equal to %s" OneOfMessage = "must be one of %s" )
バリデーションメッセージ
View Source
const ( CustomUniqueMessage = "already exists" UnableConvertBase64Message = "cannot be converted to base64" )
カスタムバリデーションメッセージ
Variables ¶
This section is empty.
Functions ¶
func ToFirebaseError ¶
Types ¶
type CustomError ¶
type CustomError struct { ErrorCode ErrorCode Value error ValidationErrors []*ValidationError }
CustomError - エラーコードを含めた構造体
func (CustomError) Validations ¶
func (ce CustomError) Validations() []*ValidationError
Validations - バリデーションエラーの詳細を返す
type ErrorCode ¶
type ErrorCode uint
ErrorCode - システムエラーの種類
const ( // ErrUnknown - 不明なエラー ErrUnknown ErrorCode = iota // ErrInvalidArgument - バリデーションエラー ErrInvalidArgument // ErrInvalidRequestValidation - バリデーションエラー (リクエスト) ErrInvalidRequestValidation // ErrInvalidDomainValidation - バリデーションエラー (ドメイン) ErrInvalidDomainValidation // ErrUnableConvertBase64 - Byte64型への変換エラー ErrUnableConvertBase64 ErrUnauthorized // ErrSessionExpired - セッションが有効期限切れ ErrSessionExpired // ErrForbidden - 権限エラー ErrForbidden // ErrPreconditionFailed - アクセス拒否 ErrPreconditionFailed // ErrNotFound - 取得エラー ErrNotFound // ErrNotExistsInDatastore - データストアに対象のレコードが存在しない ErrNotExistsInDatastore // ErrNotExistsInStorage - ストレージに対象のファイルが存在しない ErrNotExistsInStorage // ErrConflict - 既存レコード,ファイルとの競合 ErrConflict ErrServiceUnavailable // ErrNotImplemented - サービスが利用不可(未実装) ErrNotImplemented // ErrGatewayTimeout - 接続タイムアウト ErrGatewayTimeout // ErrInternal - 内部エラー ErrInternal // ErrInDatastore - データベースエラー ErrInDatastore // ErrInStorage - ストレージエラー ErrInStorage )
type ValidationError ¶
ValidationError - バリデーションエラー用構造体
Click to show internal directories.
Click to hide internal directories.