validations

package module
v0.0.0-...-9eccf32 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewError

func NewError(resource interface{}, column, err string) error

NewError generate a new error for a model's field

func RegisterCallBacks

func RegisterCallBacks(db *gorm.DB)

'RegisterCallBacks' register callback into GORM DB

Types

type Error

type Error struct {
	Resource interface{}
	Column   string
	Message  string
}

'Error' is a validation error struct that hold model, column and error message

func (Error) Error

func (err Error) Error() string

'Error' show error message

func (Error) Label

func (err Error) Label() string

'Label' is a label including model type, primary key and column name

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL