Documentation
¶
Index ¶
Constants ¶
View Source
const ( CreatePaymentNotification = "新しい支払い情報が追加されました." UpdatePaymentNotification = "支払い情報が更新されました." CreateGroupNotification = "新しいグループが作成されました." UpdateGroupNotification = "グループ情報が更新されました." AddUserInGroupNotification = "グループに招待されました." )
プッシュ通知メッセージ
View Source
const ( RequiredTag = "required" EqFieldTag = "eqfield" MinTag = "min" MaxTag = "max" EmailTag = "email" PasswordTag = "password" UniqueTag = "unique" )
バリデーションタグ
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" EmailMessage = "should be in email format" PasswordMessage = "should be in password format" UniqueMessage = "must be unique" )
バリデーションメッセージ
View Source
const ( CustomUniqueMessage = "already exists" CustomNotExistsMessage = "contains a value that does not exist" UnableConvertBase64Massage = "cannot be converted to base64" )
カスタムバリデーションメッセージ
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 ( // Unknown - 不明なエラー Unknown ErrorCode = iota Unauthorized // Forbidden - 権限エラー Forbidden // NotFound - 取得エラー NotFound // InvalidDomainValidation - ドメインのバリデーションエラー InvalidDomainValidation // InvalidRequestValidation - リクエストのバリデーションエラー InvalidRequestValidation // UnableParseJSON - JSON型から構造体への変換エラー UnableParseJSON // UnableConvertBase64 - Byte64型への変換エラー UnableConvertBase64 // ErrorInDatastore - データストアでのエラー ErrorInDatastore // AlreadyExistsInDatastore - ユニークチェックでのエラー AlreadyExistsInDatastore // NotEqualRequestWithDatastore - リクエスト値がデータストアの値と一致しない NotEqualRequestWithDatastore // ErrorInStorage - ストレージでのエラー ErrorInStorage // ErrorInOtherAPI - 別APIへのリクエストでのエラー ErrorInOtherAPI )
type ValidationError ¶
ValidationError - バリデーションエラー用構造体
Click to show internal directories.
Click to hide internal directories.