routes

package
v0.0.0-...-e041085 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const URLPrefix = "/api"

URLPrefix ...

Variables

This section is empty.

Functions

func InitRoutes

func InitRoutes(r Context, p HandlerServiceProvider)

InitRoutes ...

Types

type Context

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

Context ...

func NewContext

func NewContext(httpClient *http.Client, prefix string) Context

NewContext ...

func NewContextWithWay

func NewContextWithWay(router way.RouterInterface, httpClient *http.Client, prefix string) Context

NewContextWithWay ... Deprecated: this is a transition function to reuse 'way' created by server

func (*Context) RegisterEndpoint

func (r *Context) RegisterEndpoint(info EndpointInfo)

RegisterEndpoint ...

func (*Context) RegisterEndpointWithPrefix

func (r *Context) RegisterEndpointWithPrefix(info EndpointInfo, prefix string)

RegisterEndpointWithPrefix ...

func (*Context) ServeHTTP

func (r *Context) ServeHTTP(w http.ResponseWriter, req *http.Request)

type EndpointInfo

type EndpointInfo struct {
	HTTPMethod    string
	URLPattern    string
	Handler       handler.EndpointHandler
	Verifications []middleware.VerificationType
}

EndpointInfo ...

type HandlerServiceProvider

type HandlerServiceProvider struct {
	DB         *db.DatabaseInterface
	Redis      *db.RedisInterface
	HTTPClient *http.Client
}

HandlerServiceProvider ...

Jump to

Keyboard shortcuts

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