api

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterPattern

func RegisterPattern(pattern string, handler http.HandlerFunc)

RegisterPattern associates the given URL path with the given handler. Call this from an init() function. Whenever a user navigates to the given pattern, the handler will be called. Note that the pattern should NOT include the ApiPathPrefix.

Types

type DefaultApiManager

type DefaultApiManager struct {
	Mux http2.Muxer
}

The DefaultApiManager type represents the default api manager that is created at bootup. The Mux variable can be replaced with the Muxer of your choice.

func NewDefaultApiManager

func NewDefaultApiManager() DefaultApiManager

NewDefaultApiManager creates a new api manager that uses config.ApiPrefix as a path prefix to determine if the given call is a REST call. It also uses Go's standard ServeMux as a muxer to direct which handler should handle the request. The Mux is public, so you can replace it with your own Muxer if desired.

func (DefaultApiManager) RegisterPattern

func (a DefaultApiManager) RegisterPattern(pattern string, handler http.Handler)

func (DefaultApiManager) ServeHTTP added in v0.17.0

func (a DefaultApiManager) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (DefaultApiManager) Use added in v0.17.0

func (a DefaultApiManager) Use()

Jump to

Keyboard shortcuts

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