model

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TimeLayout represent time layout for parsing time.
	TimeLayout = "2006-01-02T15:04:05"
)

Variables

This section is empty.

Functions

func FixDate

func FixDate(lexeme string) string

Types

type Operation

type Operation struct {
	Person      string   `json:"person" db:"person" csv:"person"`
	RegAddress  *string  `json:"reg_address" db:"reg_address" csv:"reg_addr_koatuu"`
	Code        int16    `json:"code" db:"code" csv:"oper_code"`
	Name        string   `json:"name" db:"name" csv:"oper_name"`
	Date        string   `json:"reg_date" db:"reg_date" csv:"d_reg"`
	OfficeID    int32    `json:"office_id" db:"office_id" csv:"dep_code"`
	OfficeName  string   `json:"office_name" db:"office_name" csv:"dep"`
	Make        string   `json:"make" db:"make" csv:"brand"`
	Model       string   `json:"model" db:"model" csv:"model"`
	Year        int16    `json:"year" db:"year" csv:"make_year"`
	Color       string   `json:"color" db:"color" csv:"color"`
	Kind        string   `json:"kind" db:"kind" csv:"kind"`
	Body        string   `json:"body" db:"body" csv:"body"`
	Purpose     string   `json:"purpose" db:"purpose" csv:"purpose"`
	Fuel        *string  `json:"fuel" db:"fuel" csv:"fuel"`
	Capacity    *int     `json:"capacity" db:"capacity" csv:"capacity"`
	OwnWeight   *float64 `json:"own_weight" db:"own_weight" csv:"own_weight"`
	TotalWeight *float64 `json:"total_weight" db:"total_weight" csv:"total_weight"`
	Number      string   `json:"number" db:"number" csv:"n_reg_new"`
	ResourceID  int64    `json:"resource_id" db:"resource_id"`
}

Operation represents entity in the store.Store.

func OperationFromGov

func OperationFromGov(columns []string) (*Operation, error)

OperationFromGov returns new instance of Operation from CSV row.

func TestOperation

func TestOperation(t *testing.T) *Operation

TestOperation return special operations for testing purposes.

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 store.Store.

func RevisionFromGov

func RevisionFromGov(revision *govdata.Revision) *Revision

RevisionFromGov returns new instance of Revision from govdata.Revision.

Jump to

Keyboard shortcuts

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