restapi

package
v0.0.0-...-4a54890 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

DBClient instance for accessing the underlying BoltDB, be it the real one or a mock.

View Source
var MessagingClient messaging.IMessagingClient

MessagingClient instance

Functions

func GetAccount

func GetAccount(w http.ResponseWriter, r *http.Request)

GetAccount loads an account instance, including a quote and an image URL using sub-services.

func HealthCheck

func HealthCheck(w http.ResponseWriter, r *http.Request)

HealthCheck will return OK if the underlying BoltDB is healthy. At least healthy enough for demoing purposes.

func NewRouter

func NewRouter() *mux.Router

NewRouter creates a mux.Router pointer.

func SetHealthyState

func SetHealthyState(w http.ResponseWriter, r *http.Request)

SetHealthyState can be used fake health problems.

Types

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

Defines a single route, e.g. a human readable name, HTTP method and the pattern the function that will execute when the route is called.

type Routes

type Routes []Route

Defines the type Routes which is just an array (slice) of Route structs.

Jump to

Keyboard shortcuts

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