database

package
v0.0.0-...-a495cf4 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2019 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(host string, name string, user string, password string) (*sql.DB, error)

Types

type BrandStore

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

Struct that satisfies BrandService

func NewBrandStore

func NewBrandStore(db *sql.DB) *BrandStore

func (BrandStore) Brand

func (s BrandStore) Brand(id string) (*yakit.Brand, error)

Get brand with ID

func (BrandStore) Brands

func (s BrandStore) Brands() ([]yakit.Brand, error)

Get all brands

func (BrandStore) CreateBrand

func (s BrandStore) CreateBrand(b yakit.Brand) (*yakit.Brand, error)

Create a new brand

func (BrandStore) DeleteBrand

func (s BrandStore) DeleteBrand(id string) error

Delete a brand

func (BrandStore) UpdateBrand

func (s BrandStore) UpdateBrand(b yakit.Brand) (*yakit.Brand, error)

Update an existing brand

type EntryStore

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

Struct that satisfies EntryService

func NewEntryStore

func NewEntryStore(db *sql.DB) *EntryStore

Create new EntryStore

func (EntryStore) CreateEntry

func (s EntryStore) CreateEntry(e yakit.Entry) (*yakit.Entry, error)

Create a new Entry

func (EntryStore) DeleteEntry

func (s EntryStore) DeleteEntry(id string) error

Delete an Entry

func (EntryStore) Entries

func (s EntryStore) Entries() ([]yakit.Entry, error)

List entries

func (EntryStore) Entry

func (s EntryStore) Entry(id string) (*yakit.Entry, error)

Get Entry with ID

func (EntryStore) UpdateEntry

func (s EntryStore) UpdateEntry(e yakit.Entry) (*yakit.Entry, error)

Update an Entry

type ModelStore

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

Struct that satisfies ModelService

func NewModelStore

func NewModelStore(db *sql.DB) *ModelStore

func (ModelStore) CreateModel

func (s ModelStore) CreateModel(m yakit.Model) (*yakit.Model, error)

Create a new model

func (ModelStore) DeleteModel

func (s ModelStore) DeleteModel(id string) error

Delete a model

func (ModelStore) Model

func (s ModelStore) Model(id string) (*yakit.Model, error)

Get Model with ID

func (ModelStore) Models

func (s ModelStore) Models(brandID string) ([]yakit.Model, error)

Get all models

func (ModelStore) UpdateModel

func (s ModelStore) UpdateModel(m yakit.Model) (*yakit.Model, error)

Update an existing model

type VehicleStore

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

Struct that satisfies VehicleService

func NewVehicleStore

func NewVehicleStore(db *sql.DB) *VehicleStore

func (VehicleStore) CreateVehicle

func (s VehicleStore) CreateVehicle(v yakit.Vehicle) (*yakit.Vehicle, error)

Create a new Vehicle

func (VehicleStore) DeleteVehicle

func (s VehicleStore) DeleteVehicle(id string) error

Delete a Vehicle

func (VehicleStore) UpdateVehicle

func (s VehicleStore) UpdateVehicle(v yakit.Vehicle) (*yakit.Vehicle, error)

Update an existing Vehicle

func (VehicleStore) Vehicle

func (s VehicleStore) Vehicle(id string) (*yakit.Vehicle, error)

Get Vehicle with ID

func (VehicleStore) Vehicles

func (s VehicleStore) Vehicles(modelID string, brandID string) ([]yakit.Vehicle, error)

Get all vehicles

Jump to

Keyboard shortcuts

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