routes

package
v0.0.0-...-fca878f Latest Latest
Warning

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

Go to latest
Published: May 25, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIRouter

type APIRouter struct {
	Mux      *chi.Mux
	Address  string
	Config   *configs.ParameterConfig
	DBHandle *drivers.DBHandle
	Handlers *Handler
}

APIRouter the svc map

func NewAPIRouter

func NewAPIRouter(opts ...Setup) (*APIRouter, error)

NewAPIRouter service new instance

func (*APIRouter) GetHandlers

func (svc *APIRouter) GetHandlers() *Handler

GetHandlers is the mapping of all the handlers

func (*APIRouter) MapRoute

func (svc *APIRouter) MapRoute() *chi.Mux

MapRoute route map all endpoints

func (*APIRouter) Run

func (svc *APIRouter) Run()

Run the http server based on settings

type Handler

type Handler struct {
	BuildingHandler buildingHandler
}

Handler wraps all handler

type Setup

type Setup func(*APIRouter)

Setup options settings

func WithSvcOptConfig

func WithSvcOptConfig(c *configs.ParameterConfig) Setup

WithSvcOptConfig opts for mux

func WithSvcOptHandler

func WithSvcOptHandler(r *Handler) Setup

WithSvcOptHandler opts for handler

func WithSvcOptMux

func WithSvcOptMux(m *chi.Mux) Setup

WithSvcOptMux opts for mux

Jump to

Keyboard shortcuts

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