interfaces

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataStore

type DataStore interface {
	Init(config.MongoConfig) (err error)
	Close(ctx context.Context) (err error)
	AddBook(ctx context.Context, book *models.Book) (err error)
	GetBook(ctx context.Context, id string) (*models.Book, error)
	GetBooks(ctx context.Context) (models.Books, error)
	GetReview(ctx context.Context, reviewID string) (*models.Review, error)
	GetReviews(ctx context.Context, bookID string) (models.Reviews, error)
	AddReview(ctx context.Context, review *models.Review) (err error)
	UpdateReview(ctx context.Context, reviewID string, review *models.Review) (err error)
}

DataStore implements the methods required to interact with the database

type HTTPServer

type HTTPServer interface {
	ListenAndServe() error
}

type HealthChecker

type HealthChecker interface {
	Handler(w http.ResponseWriter, req *http.Request)
	Start(ctx context.Context)
	Stop()
	AddCheck(name string, checker healthcheck.Checker) (err error)
}

HealthChecker defines the required methods from Healthcheck

type Initialiser

type Initialiser interface {
	GetHTTPServer(BindAddr string, router http.Handler) HTTPServer
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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