model

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Required     = "required"
	Invalid      = "invalid"
	IsNotInreger = "is_not_integer"
)
View Source
const DateLayout = "2006-01-02"

Variables

View Source
var (
	ErrResourceNotFound = NewError("resource.not_found")
)

Functions

This section is empty.

Types

type Error

type Error struct {
	// contains filtered or unexported fields
}

func NewError

func NewError(text string) Error

func (Error) Error

func (e Error) Error() string

type Operation

type Operation struct {
	Person      string   `json:"person" db:"person"`
	RegAddress  *string  `json:"reg_addr_koatuu,omitempty" db:"reg_address"`
	RegCode     int      `json:"registration_code" db:"code"`
	Reg         string   `json:"registration" db:"name"`
	Date        string   `json:"date" db:"reg_date"`
	DepCode     int32    `json:"dep_code" db:"office_id"`
	Dep         string   `json:"dep" db:"office_name"`
	Brand       string   `json:"brand" db:"make"`
	Model       string   `json:"model" db:"model"`
	VIN         *string  `json:"vin,omitempty" db:"vin"`
	Year        int16    `json:"year" db:"year"`
	Color       string   `json:"color" db:"color"`
	Kind        string   `json:"kind" db:"kind"`
	Body        string   `json:"body" db:"body"`
	Purpose     string   `json:"purpose" db:"purpose"`
	Fuel        *string  `json:"fuel,omitempty" db:"fuel"`
	Capacity    *int     `json:"capacity,omitempty" db:"capacity"`
	OwnWeight   *float64 `json:"own_weight,omitempty" db:"own_weight"`
	TotalWeight *float64 `json:"total_weight,omitempty" db:"total_weight"`
	Number      string   `json:"number" db:"number"`
	ResourceID  int64    `json:"-" db:"resource_id"`
}

Operation represents entity in the domain.Store.

func TestOperation

func TestOperation(t *testing.T) *Operation

TestOperation return special operations for testing purposes.

func (*Operation) PrettyPerson

func (op *Operation) PrettyPerson() string

type Resource

type Resource struct {
	ID           int64     `json:"id" db:"id"`
	UID          string    `json:"uid" db:"uid"`
	Name         string    `json:"name" db:"name"`
	URL          string    `json:"url" db:"url"`
	LastModified time.Time `json:"last_modified" db:"last_modified"`
	CreatedAt    time.Time `json:"created_at" db:"created_at"`
}

Resource represents entity from the data.gov.ua web portal.

func TestResource

func TestResource(t *testing.T) *Resource

TestResource return special resource for testing purposes.

type Revision

type Revision struct {
	ID          string    `json:"id" db:"id"`
	URL         string    `json:"url" db:"url"`
	FileHashSum *string   `json:"file_hash_sum" db:"file_hash_sum"`
	Deleted     int32     `json:"deleted" db:"deleted"`
	Added       int32     `json:"added" db:"added"`
	CreatedAt   time.Time `json:"created_at" db:"created_at"`
}

Revision represents entity in the domain.Store.

type ValidationError added in v0.0.31

type ValidationError struct {
	Messages map[string][]string
}

func NewValidationError added in v0.0.31

func NewValidationError(messages map[string][]string) ValidationError

func (*ValidationError) Append added in v0.0.31

func (e *ValidationError) Append(field string, message ...string)

func (ValidationError) Error added in v0.0.31

func (e ValidationError) Error() string

func (ValidationError) WithPrefix added in v0.0.31

func (e ValidationError) WithPrefix(prefix string) ValidationError

Jump to

Keyboard shortcuts

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