Documentation ¶
Index ¶
- Constants
- Variables
- func FixBrandModel(brandModel, model string) (resBrand, resModel string)
- func FixDate(lexeme string) string
- type Error
- type Operation
- type OperationRepository
- type Parser
- type ReadOperationRepository
- type Resource
- type ResourceRepository
- type Revision
- type Store
- type UserOperationService
- type WriteOperationRepository
Constants ¶
View Source
const DateLayout = "2006-01-02"
Variables ¶
View Source
var (
ErrNotFound = NewError("record not found")
)
Functions ¶
func FixBrandModel ¶
FixBrandModel returns fixed brand.
Types ¶
type Operation ¶
type Operation struct { Person string `json:"person" db:"person" csv:"person"` RegAddress *string `json:"reg_addr_koatuu,omitempty" db:"reg_address" csv:"reg_addr_koatuu"` RegCode int16 `json:"registration_code" db:"code" csv:"oper_code"` Reg string `json:"registration" db:"name" csv:"oper_name"` Date string `json:"date" db:"reg_date" csv:"d_reg"` DepCode int32 `json:"dep_code" db:"office_id" csv:"dep_code"` Dep string `json:"dep" db:"office_name" csv:"dep"` Brand string `json:"brand" 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,omitempty" db:"fuel" csv:"fuel"` Capacity *int `json:"capacity,omitempty" db:"capacity" csv:"capacity"` OwnWeight *float64 `json:"own_weight,omitempty" db:"own_weight" csv:"own_weight"` TotalWeight *float64 `json:"total_weight,omitempty" db:"total_weight" csv:"total_weight"` Number string `json:"number" db:"number" csv:"n_reg_new"` ResourceID int64 `json:"-" db:"resource_id" csv:"-"` }
Operation represents entity in the domain.Store.
func OperationFromGov ¶
OperationFromGov returns new instance of Operation from CSV row.
func TestOperation ¶
TestOperation return special operations for testing purposes.
func (*Operation) PrettyPerson ¶
type OperationRepository ¶
type OperationRepository interface { ReadOperationRepository WriteOperationRepository }
type Parser ¶
type Parser interface {
Parse(ctx context.Context, resource *Resource, r *bulkreader.BulkReader) error
}
type ReadOperationRepository ¶
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 ¶
TestResource return special resource for testing purposes.
type ResourceRepository ¶
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 Store ¶
type Store interface { Resource() ResourceRepository Operation() OperationRepository }
type UserOperationService ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.