read

package
v0.0.0-...-cde7464 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Schema = &memdb.DBSchema{
	Tables: map[string]*memdb.TableSchema{
		"product": &memdb.TableSchema{
			Name: "product",
			Indexes: map[string]*memdb.IndexSchema{
				"id": &memdb.IndexSchema{
					Name:    "id",
					Unique:  true,
					Indexer: &memdb.StringFieldIndex{Field: "SKU"},
				},
			},
		},
	},
}

Schema is the schema for the read model

Functions

func MakeProductMessageCallBack

func MakeProductMessageCallBack(db *memdb.MemDB) nats.MsgHandler

MakeProductMessageCallBack is a factory function that creates the product message callback that is used as the asynchronous subscriber by NATS

Types

type Handler

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

Handler represents the read http handler

func NewHandler

func NewHandler(db *memdb.MemDB) *Handler

NewHandler creates a new read Handler

func (*Handler) GetProducts

func (h *Handler) GetProducts(rw http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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