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
}
Click to show internal directories.
Click to hide internal directories.