router

package
v0.0.0-...-eb599cc Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Revision string

Revision is the service's revision and should be set at build time to the current commit hash.

Functions

This section is empty.

Types

type PingResponse

type PingResponse struct {
	Ping string `json:"ping,omitempty"`
}

PingResponse is returned when a GET request to /ping is made

type Router

type Router struct {
	// contains filtered or unexported fields
}

Router sets up a Taxi server

func New

func New() *Router

New returns a new router initialised with default middleware

func (*Router) GetName

func (r *Router) GetName() string

GetName returns a friendly name for the process

func (*Router) RegisterHandler

func (r *Router) RegisterHandler(method, path string, handler taxi.HandlerFunc)

RegisterHandler adds a route to the router

func (*Router) Start

func (r *Router) Start() error

Start will listen for TCP connections on the port defined in config

func (*Router) Stop

func (r *Router) Stop(ctx context.Context) error

Stop will gracefully shutdown the server

Jump to

Keyboard shortcuts

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