api

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HelloHandler

func HelloHandler() http.HandlerFunc

HelloHandler returns function containing a simple hello world example of an api handler

Types

type API

type API struct {
	Router *mux.Router
	// contains filtered or unexported fields
}

API provides a struct to wrap the api around

func Setup

func Setup(ctx context.Context, r *mux.Router, mongoDB MongoServer) *API

Setup function sets up the api and returns an api

type AuthHandler added in v0.2.0

type AuthHandler interface {
	Require(required dpauth.Permissions, handler http.HandlerFunc) http.HandlerFunc
}

AuthHandler interface for adding auth to endpoints

type HelloResponse

type HelloResponse struct {
	Message string `json:"message,omitempty"`
}

type MongoServer added in v0.2.0

type MongoServer interface {
	Close(ctx context.Context) error
	Checker(ctx context.Context, state *healthcheck.CheckState) (err error)
}

MongoServer defines the required methods from MongoDB

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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