model

package
v0.0.0-...-3bbbb78 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	ServerConfig *ServerConfig `json:'serverConfig'`
	CacheConfig  *CacheConfig  `json:"cacheConfig"`
	DBConfig     *DBConfig     `json:"dbConfig"`
}

type Cache

type Cache interface {
	Get(id string) string
	Put(id, name string)
}

type CacheConfig

type CacheConfig struct {
	Size int `json:"capacity"`
}

type DB

type DB interface {
	GetProducts() ([]Product, error)
	GetCarWithId(id string) (Product, error)
	GetAccessoryWithId(id string) (Product, error)
	GetAccessories() ([]Product, error)
	GetCars() ([]Product, error)
	GetRecentItems() ([]Product, error)
	SetSelectedItem(product Product) (bool, error)
}

type DBConfig

type DBConfig struct {
	Env  string `json:"env"` // defines the env for DB (Testing, Development, Production)
	Host string `json:"host"`
	Port int    `json:"port"`
}

type Product

type Product struct {
	ID    primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"`
	Name  string             `json:"name,omitempty" bson:"name,omitempty"`
	Price float64            `json:"price" bson:"price,omitempty`
	Type  string             `json:"type" bson:"type,omitempty"`
}

type ServerConfig

type ServerConfig struct {
	Host string `json:"host"`
	Port int    `json:"port"`
}

Jump to

Keyboard shortcuts

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