Documentation
¶
Index ¶
- Variables
- func Failed(resource interface{}, column, err string, path ...string) error
- func FieldFailed(resource interface{}, fieldName, err string, path ...string) error
- func IDToString(id aorm.ID) string
- func IsError(err ...error) bool
- func NewError(resource interface{}, column, err string) error
- func RegisterCallbacks(db *aorm.DB) *aorm.DB
- func RegisteredCallbacks(db *aorm.DB) bool
- func RegisteredCallbacksOrError(db *aorm.DB)
- type Error
- type ValidationFailed
Constants ¶
This section is empty.
Variables ¶
View Source
var PREFIX = path_helpers.GetCalledDir()
View Source
var VALIDATE_CALLBACK = PREFIX + ":validate"
Functions ¶
func FieldFailed ¶
NewError generate a new error for a model's field
func IDToString ¶
func RegisterCallbacks ¶
RegisterCallbacks register callback into GORM DB
func RegisteredCallbacks ¶
Types ¶
type ValidationFailed ¶
type ValidationFailed struct { Resource interface{} Column string FieldName string Message string Path string }
Error is a validation error struct that hold model, column and error message
func (ValidationFailed) Label ¶
func (err ValidationFailed) Label() string
Label is a label including model type, primary key and column name
Click to show internal directories.
Click to hide internal directories.