adsa-cms: github.com/mmanjoura/adsa-cms/validations Index | Files

package validations

import "github.com/mmanjoura/adsa-cms/validations"

Index

Package Files

callbacks.go validations.go

func NewError Uses

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

NewError generate a new error for a model's field

func RegisterCallbacks Uses

func RegisterCallbacks(db *gorm.DB)

RegisterCallbacks register callback into GORM DB

type Error Uses

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 Uses

func (err Error) Error() string

Error show error message

func (Error) Label Uses

func (err Error) Label() string

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

Package validations imports 5 packages (graph) and is imported by 6 packages. Updated 2017-06-08. Refresh now. Tools for package owners.