http

package
v0.0.0-...-30135e4 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logger

func Logger(inner http.Handler, name string) http.Handler

Serve and log an incoming request

func NewRouter

func NewRouter(api APIHandler) *mux.Router

Bind routes to handlers and create a router

Types

type APIHandler

type APIHandler struct {
	FeatureService services.FeatureService
}

Handles incoming requests

func (APIHandler) FeatureAccess

func (handler APIHandler) FeatureAccess(w http.ResponseWriter, r *http.Request)

func (APIHandler) FeatureCreate

func (handler APIHandler) FeatureCreate(w http.ResponseWriter, r *http.Request)

func (APIHandler) FeatureEdit

func (handler APIHandler) FeatureEdit(w http.ResponseWriter, r *http.Request)

func (APIHandler) FeatureIndex

func (handler APIHandler) FeatureIndex(w http.ResponseWriter, r *http.Request)

func (APIHandler) FeatureRemove

func (handler APIHandler) FeatureRemove(w http.ResponseWriter, r *http.Request)

func (APIHandler) FeatureShow

func (handler APIHandler) FeatureShow(w http.ResponseWriter, r *http.Request)

func (APIHandler) FeaturesAccess

func (handler APIHandler) FeaturesAccess(w http.ResponseWriter, r *http.Request)

type APIMessage

type APIMessage struct {

	// A status message
	Status string `json:"status"`
	// A human readable message
	Message string `json:"message"`
	// contains filtered or unexported fields
}

A simple structure to respond with error messages

type AccessRequest

type AccessRequest struct {
	Groups []string `json:"groups"`
	User   uint32   `json:"user"`
}

Describes the request when checking the access to a feature

type Route

type Route struct {
	// A human readable name for the route
	Name string
	// The HTTP method
	Method string
	// The URL
	Pattern string
	// The handler for this endpoint
	HandlerFunc http.HandlerFunc
}

type Routes

type Routes []Route

Jump to

Keyboard shortcuts

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