model

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	ID        uuid.UUID  `gorm:"type:uuid;primary_key;"`
	CreatedAt time.Time  `gorm:"column:createdOn"`
	UpdatedAt time.Time  `gorm:"column:modifiedOn"`
	DeletedAt *time.Time `sql:"index" gorm:"deletedOn"`
}

Base contains common columns for all tables.

type HTTPError

type HTTPError struct {
	HTTPStatus int
	ErrorKey   string
}

HTTPError Represent an error to be sent back on repsonse

func NewHTTPError

func NewHTTPError(err string, httpStatus int) HTTPError

NewHTTPError creates an new instance of HTTP Error

func (HTTPError) Error

func (err HTTPError) Error() string

Error returns the error string

type ValidationError

type ValidationError struct {
	ErrorKey string            `json:"errorKey"`
	Errors   map[string]string `json:"errors"`
}

ValidationError is an error indicating error in validations

func NewValidationError

func NewValidationError(err string, failedValidations map[string]string) ValidationError

NewValidationError creates an new instance of Validation Error

func (ValidationError) Error

func (e ValidationError) Error() string

Jump to

Keyboard shortcuts

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