store

package
v0.0.0-...-e29e17f Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: Apache-2.0, Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrDuplicateStore represents an error when inserting a non unique store
	ErrDuplicateStore = errors.New("store location and name must be unique")
)

Functions

This section is empty.

Types

type Service

type Service struct {
	DB *sqlx.DB
}

Service contains functionality for managing the document data service

func NewService

func NewService(db *sqlx.DB) *Service

NewService returns a new agent service

func (*Service) CreateStoreIfNotExists

func (serv *Service) CreateStoreIfNotExists(s *Store) (*Store, bool, error)

CreateStoreIfNotExists creates a new store if it does not exist or returns it if it does

func (*Service) GetStore

func (serv *Service) GetStore() (*Store, error)

GetStore retrieves a store from the database

type Store

type Store struct {
	ID       uuid.UUID `json:"id" db:"store_id"`
	Location string    `json:"-" db:"location"`
	Created  time.Time `json:"created" db:"created"`
	Updated  time.Time `json:"updated" db:"updated"`
}

Store represents an annoy store

Jump to

Keyboard shortcuts

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