Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrRecordNotFound = errors.New("record not found")
)
Functions ¶
This section is empty.
Types ¶
type RevisionRepository ¶
type RevisionRepository interface { Create(revision *model.Revision) error FindByID(id string) (*model.Revision, error) Last() (*model.Revision, error) All() ([]model.Revision, error) AllWithLimit(limit uint64) ([]model.Revision, error) AllIDs() ([]string, error) Stats() ([]model.RevisionStatMonth, error) }
type Store ¶
type Store interface { Revision() RevisionRepository Vehicle() VehicleRepository }
type Transport ¶
Transport is a wrapper for slice of WantedVehicle.
func (Transport) Less ¶
Less reports whether the element with index i should sort before the element with index j.
func (Transport) Search ¶
Search returns id of element, which has specified ID. Transport array should be pre-sorted.
Uses binary-search algorithm under the hood. More about algorithm: https://en.wikipedia.org/wiki/Binary_search_algorithm.
type VehicleRepository ¶
type VehicleRepository interface { Create(revision *model.Revision, added []model.Vehicle, removed []string) error FindByNumber(number string) ([]model.Vehicle, error) FindByVIN(vin string) ([]model.Vehicle, error) FindByRevisionID(id string) ([]model.Vehicle, error) All() ([]model.Vehicle, error) AllWithLimit(limit uint64) ([]model.Vehicle, error) }
Click to show internal directories.
Click to hide internal directories.