O'Reilly logo

Isomorphic Go by Kamesh Balasubramanian

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The custom datastore

A custom datastore has been implemented for the IGWEB demo website. Although we will be using Redis as the exclusive database for this book, the truth is, you are free to use just about any database your heart desires—as long as you create a custom datastore that implements the Datastore interface.

Let's examine the section where we've defined the Datastore interface in the datastore.go source file found in the common/datastore folder:

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required