handler

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, creator Creator) error

Register registers the 'creator' Creator under provided 'name'.

Types

type Creator

Creator is the function used to create new router instance.

func Get

func Get(name string) (Creator, error)

Get gets the handler registered under provided 'name'.

type Handler

type Handler interface {
	// SetRoutes sets the routes for all the models stored in the handler's controller.
	SetRoutes() error
	// SetModelRoutes sets the routes for a single model within a handler.
	// The 'model' might be a struct instance or the neuron mapping.ModelStruct.
	SetModelRoutes(model interface{}) error
	// Router returns  httprouter implementation.
	Router() *httprouter.Router
}

Handler is the interface used as the neuron API handlers.

type QualityValue

type QualityValue struct {
	Value   string
	Quality float64
}

QualityValue is the structure that contains quality - value pair.

func ParseAcceptEncoding

func ParseAcceptEncoding(header http.Header) []QualityValue

ParseAcceptEncoding parses 'Accept-Encoding' header values sorted by it's quality.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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