Documentation ¶
Index ¶
- type Registration
- type RegistrationStore
- func (s *RegistrationStore) AllSeries(ctx context.Context) ([]string, error)
- func (s *RegistrationStore) Create(ctx context.Context, registration *model.Registration) error
- func (s *RegistrationStore) FindByCode(ctx context.Context, code string) (*model.Registration, error)
- func (s *RegistrationStore) FindByNumber(ctx context.Context, number string) ([]model.Registration, error)
- func (s *RegistrationStore) FindByVIN(ctx context.Context, vin string) ([]model.Registration, error)
- func (s *RegistrationStore) FindLastBySeries(ctx context.Context, series string) (*model.Registration, error)
- func (s *RegistrationStore) Health(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Registration ¶ added in v0.1.18
type Registration struct { Brand *string `db:"brand"` Capacity *int `db:"capacity"` Color string `db:"color"` FirstRegDate *string `db:"d_first_reg"` Date *string `db:"d_reg"` Fuel *string `db:"fuel"` Kind *string `db:"kind"` Year int `db:"make_year"` Model *string `db:"model"` NDoc string `db:"n_doc"` SDoc string `db:"s_doc"` Code string `db:"code"` Number string `db:"n_reg_new"` NumSeating *int `db:"n_seating"` NumStanding *int `db:"n_standing"` OwnWeight *float64 `db:"own_weight"` RankCategory *string `db:"rank_category"` TotalWeight *float64 `db:"total_weight"` VIN *string `db:"vin"` }
type RegistrationStore ¶ added in v0.1.18
type RegistrationStore struct {
// contains filtered or unexported fields
}
Store is postgres wrapper for store.Store.
func New ¶
func New(conf *config.Database) (*RegistrationStore, error)
New returns new instance of store.
func (*RegistrationStore) AllSeries ¶ added in v0.1.18
func (s *RegistrationStore) AllSeries(ctx context.Context) ([]string, error)
AllSeries returns list of all known series.
func (*RegistrationStore) Create ¶ added in v0.1.18
func (s *RegistrationStore) Create(ctx context.Context, registration *model.Registration) error
Create adds new record to the database.
func (*RegistrationStore) FindByCode ¶ added in v0.1.18
func (s *RegistrationStore) FindByCode(ctx context.Context, code string) (*model.Registration, error)
FindByCode returns registrations with specified code.
func (*RegistrationStore) FindByNumber ¶ added in v0.1.18
func (s *RegistrationStore) FindByNumber(ctx context.Context, number string) ([]model.Registration, error)
FindByNumber returns registrations with specified number.
func (*RegistrationStore) FindByVIN ¶ added in v0.1.18
func (s *RegistrationStore) FindByVIN(ctx context.Context, vin string) ([]model.Registration, error)
FindByVIN returns registrations with specified VIN.
func (*RegistrationStore) FindLastBySeries ¶ added in v0.1.18
func (s *RegistrationStore) FindLastBySeries(ctx context.Context, series string) (*model.Registration, error)
GetLast returns last registration from the database.
Click to show internal directories.
Click to hide internal directories.