datastore

package
v0.0.0-...-7f44f1c Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2018 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REDIS = iota
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Datastore

type Datastore interface {
	CreateGopherTeam(team []*models.Gopher) error
	GetGopherTeam() []*models.Gopher
	CreateProduct(product *models.Product) error
	CreateProductRegistry(products []string) error
	GetProducts() []*models.Product
	GetProductDetail(productTitle string) *models.Product
	GetProductsInShoppingCart(cart *models.ShoppingCart) []*models.Product
	CreateContactRequest(contactRrequest *models.ContactRequest) error
	Close()
}

func NewDatastore

func NewDatastore(datastoreType int, dbConnectionString string) (Datastore, error)

type RedisDatastore

type RedisDatastore struct {
	*pool.Pool
}

func NewRedisDatastore

func NewRedisDatastore(address string) (*RedisDatastore, error)

func (*RedisDatastore) Close

func (r *RedisDatastore) Close()

func (*RedisDatastore) CreateContactRequest

func (r *RedisDatastore) CreateContactRequest(contactRequest *models.ContactRequest) error

func (*RedisDatastore) CreateGopherTeam

func (r *RedisDatastore) CreateGopherTeam(team []*models.Gopher) error

func (*RedisDatastore) CreateProduct

func (r *RedisDatastore) CreateProduct(product *models.Product) error

func (*RedisDatastore) CreateProductRegistry

func (r *RedisDatastore) CreateProductRegistry(products []string) error

func (*RedisDatastore) GenerateProductsMap

func (r *RedisDatastore) GenerateProductsMap(products []*models.Product) map[string]*models.Product

func (*RedisDatastore) GetGopherTeam

func (r *RedisDatastore) GetGopherTeam() []*models.Gopher

func (*RedisDatastore) GetProductDetail

func (r *RedisDatastore) GetProductDetail(productTitle string) *models.Product

func (*RedisDatastore) GetProducts

func (r *RedisDatastore) GetProducts() []*models.Product

func (*RedisDatastore) GetProductsInShoppingCart

func (r *RedisDatastore) GetProductsInShoppingCart(cart *models.ShoppingCart) []*models.Product

Jump to

Keyboard shortcuts

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