router

package
v0.0.0-...-0ddd045 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package router provides the top-level router

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Router

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

Router is the top-level router instance wrapping it's dependencies TODO <2020/12/09>: Think about a better way to pass in the broadcatser hub

func New

func New(c *config.Config, l *log.Logger) *Router

New creates a new router instance and returns it

func (*Router) AddRoutes

func (r *Router) AddRoutes(handle *handlers.Handler)

AddRoutes adds all routes to the router instance and registers the handlers

func (*Router) Run

func (r *Router) Run()

Run starts the HTTP Server or returns an error

func (*Router) Stop

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

Stop gracefully stops the router

Source Files

  • router.go

Directories

Path Synopsis
Package handlers provides HTTP handlers
Package handlers provides HTTP handlers

Jump to

Keyboard shortcuts

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