sqlstore

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RegistrationRepository

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

RegistrationRepository is responsible for registrations manipulation.

func (*RegistrationRepository) AllSeries

func (r *RegistrationRepository) AllSeries() ([]string, error)

AllSeries returns list of all known series.

func (*RegistrationRepository) Create

func (r *RegistrationRepository) Create(registration *model.Registration) error

Create adds new record to the database.

func (*RegistrationRepository) FindByCode

func (r *RegistrationRepository) FindByCode(code string) (*model.Registration, error)

FindByCode returns registrations with specified code.

func (*RegistrationRepository) FindByNumber

func (r *RegistrationRepository) FindByNumber(number string) ([]model.Registration, error)

FindByNumber returns registrations with specified number.

func (*RegistrationRepository) FindByVIN

func (r *RegistrationRepository) FindByVIN(vin string) ([]model.Registration, error)

FindByVIN returns registrations with specified VIN.

func (*RegistrationRepository) GetLast

func (r *RegistrationRepository) GetLast(series string) (*model.Registration, error)

GetLast returns last registration from the database.

type Store

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

Store is postgres wrapper for store.Store.

func New

func New(conf *config.Database) (*Store, error)

New returns new instance of store.

func TestDB

func TestDB(t *testing.T, conf *config.Database) (*Store, func(...string))

TestDB returns special test connection and teardown function.

func (*Store) Registration

func (s *Store) Registration() store.RegistrationRepository

Registration is responsible for registrations manipulation.

Jump to

Keyboard shortcuts

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