teststore

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OperationRepository

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

OperationRepository is responsible for operations data.

func (*OperationRepository) Create

func (r *OperationRepository) Create(operations ...model.Operation) error

Create adds new records to the operations table.

func (*OperationRepository) DeleteByResourceID

func (r *OperationRepository) DeleteByResourceID(id int64) (int64, error)

DeleteByResourceID removes records with specified resource_id from operations table.

func (*OperationRepository) FindByNumber added in v0.0.4

func (r *OperationRepository) FindByNumber(number string) ([]model.Operation, error)

FindByNumber returns list operations on verhicles with specified number plates.

type ResourceRepository

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

func (*ResourceRepository) All

func (r *ResourceRepository) All() ([]model.Resource, error)

func (*ResourceRepository) Create

func (r *ResourceRepository) Create(resource *model.Resource) error

func (*ResourceRepository) FindByUID

func (r *ResourceRepository) FindByUID(uid string) (*model.Resource, error)

func (*ResourceRepository) Update

func (r *ResourceRepository) Update(resource *model.Resource) error

type Store

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

func New

func New() *Store

func (*Store) Resource

func (s *Store) Resource() store.ResourceRepository

func (*Store) Vehicle

func (s *Store) Vehicle() store.OperationRepository

Jump to

Keyboard shortcuts

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