rest

package
v0.0.0-...-bf8aa72 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Provide(
	NewRouter,
)

Module contains all the dependencies that power rest api routing

Functions

This section is empty.

Types

type Controller

type Controller struct {
	fx.Out
	Ctrl Registerable `group:"controllers"`
}

Controller is an entity used to wrap Registerables and make them available for dependency injection

func MakeController

func MakeController(r Registerable) Controller

MakeController is a convenience utility function to make an api controller from a Registerable

type Controllers

type Controllers struct {
	fx.In
	Controllers []Registerable `group:"controllers"`
}

Controllers are a grouping of all Registerables intended to be used as handlers for the API

type Registerable

type Registerable interface {
	Register(*httprouter.Router)
}

Registerable has a single Register method which takes an http.Handler as a single argument - intended to be used by the implementor to register handlers to a router

type Router

type Router struct {
	http.Handler
}

Router is responsible for routing API requests

func NewRouter

func NewRouter(registered Controllers, logger *middleware.Logger) Router

NewRouter returns an http.Handler for the On Call rest API

Jump to

Keyboard shortcuts

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