handlers

package
v0.0.0-...-8401909 Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Package handlers contains the full set of handler functions and routes supported by the web api.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIMux

func APIMux(cfg APIMuxConfig, options ...func(opts *Options)) http.Handler

APIMux constructs an http.Handler with all application routes defined.

func DebugMux

func DebugMux(build string, log *zap.SugaredLogger, couchClient *kivik.Client, algodClient *algod.Client) http.Handler

DebugMux registers all the debug standard library routes and then custom debug application routes for the service. This bypassing the use of the DefaultServerMux. Using the DefaultServerMux would be a security risk since a dependency could inject a handler into our service without us knowing it.

func DebugStandardLibraryMux

func DebugStandardLibraryMux() *http.ServeMux

DebugStandardLibraryMux registers all the debug routes from the standard library into a new mux bypassing the use of the DefaultServerMux. Using the DefaultServerMux would be a security risk since a dependency could inject a handler into our service without us knowing it.

func WithCORS

func WithCORS(origin string) func(opts *Options)

WithCORS provides configuration options for CORS.

Types

type APIMuxConfig

type APIMuxConfig struct {
	Shutdown      chan os.Signal
	APIProtocol   string
	APIHost       string
	Log           *zap.SugaredLogger
	Auth          *auth.Auth
	AlgodClient   *algod.Client
	IndexerClient *indexer.Client
	CouchClient   *kivik.Client
	Hub           *websocket.Hub
	DBName        string
}

APIMuxConfig contains all the mandatory systems required by handlers.

type Options

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

Options represent optional parameters.

Directories

Path Synopsis
apidoc
swaggergrp
Package swaggergrp maintains the group of handlers for serving swagger documentation.
Package swaggergrp maintains the group of handlers for serving swagger documentation.
debug
checkgrp
Package checkgrp maintains the group of handlers for health checking.
Package checkgrp maintains the group of handlers for health checking.
samplegrp
Package samplegrp maintains the group of handlers for sample endpoints.
Package samplegrp maintains the group of handlers for sample endpoints.
v1
Package v1 contains the full set of handler functions and routes supported by the v1 web api.
Package v1 contains the full set of handler functions and routes supported by the v1 web api.
productgrp
Package productgrp maintains the group of handlers for product access.
Package productgrp maintains the group of handlers for product access.
usergrp
Package usergrp maintains the group of handlers for user access.
Package usergrp maintains the group of handlers for user access.

Jump to

Keyboard shortcuts

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