Documentation ¶
Index ¶
Constants ¶
const ( // CreatedAt defines the name of the field/column/attribute of the record // that defines when the record was created or stored for the first time // in the data store CreatedAt = "created_at" // UpdatedAt defines the name of the field/column/attribute of the record // that defines when the record was updated for the last time // in the data store UpdatedAt = "updated_at" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FieldError ¶
type FieldError struct {
// contains filtered or unexported fields
}
FieldError holds the error message for a specific field
func NewFieldError ¶
func NewFieldError(field string, message string) (*FieldError, error)
NewFieldError creates a new instance of FieldError
func (*FieldError) IsZero ¶
func (fe *FieldError) IsZero() bool
IsZero defines whether FieldError is empty
func (*FieldError) Message ¶
func (fe *FieldError) Message() string
Message returns the error message related to the field
type Pager ¶ added in v1.11.0
type Pager struct {
// contains filtered or unexported fields
}
Pager defines all the parameters needed to list records properly
type Record ¶
type Record struct {
// contains filtered or unexported fields
}
Record defines the data that holds the mapping between the name of the field and its value
func (*Record) GetValueByKey ¶
GetValueByKey returns the value of a specific key from the data
type RecordValidationErrors ¶
type RecordValidationErrors struct {
// contains filtered or unexported fields
}
RecordValidationErrors holds all the errors that were generated for validation of every field related to an entity
func NewRecordValidationErrors ¶
func NewRecordValidationErrors() *RecordValidationErrors
NewRecordValidationErrors creates a new instance of RecordValidationErrors
func (*RecordValidationErrors) AddError ¶
func (rve *RecordValidationErrors) AddError(fieldError *FieldError)
AddError adds a single error to the error list. A single error means that it adds the error message related to a field
func (*RecordValidationErrors) Error ¶
func (rve *RecordValidationErrors) Error() string
Error returns a strigified version of all the errors. This method follows the default golang error interface
func (*RecordValidationErrors) Errors ¶
func (rve *RecordValidationErrors) Errors() []*FieldError
Errors returns the list of errors
func (*RecordValidationErrors) IsZero ¶
func (rve *RecordValidationErrors) IsZero() bool
IsZero defines whether RecordValidationErrors is empty