routing

package
v0.1.8-1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ApiRoutes = []APIRoute{
	{"serviceTypes:create", "POST", "/service-types", handlers.ServiceTypeCreate, true},
	{"serviceTypes:ListOne", "GET", "/service-types/{service-type}", handlers.ServiceTypesListOne, true},
	{"serviceTypes:DeleteOne", "DELETE", "/service-types/{service-type}", handlers.ServiceTypeDeleteOne, true},
	{"serviceTypes:ListOne", "PUT", "/service-types/{service-type}", handlers.ServiceTypeUpdate, true},
	{"serviceType:ListAll", "GET", "/service-types", handlers.ServiceTypeListAll, true},
	{"authMethod:Create", "POST", "/service-types/{service-type}/authm", handlers.AuthMethodCreate, true},
	{"authMethod:ListOne", "GET", "/service-types/{service-type}/hosts/{host}/authm", handlers.AuthMethodListOne, true},
	{"authMethod:Delete", "DELETE", "/service-types/{service-type}/hosts/{host}/authm", handlers.AuthMethodDeleteOne, true},
	{"authMethod:Delete", "PUT", "/service-types/{service-type}/hosts/{host}/authm", handlers.AuthMethodUpdateOne, true},
	{"bindings:ListAllByServiceTypeAndHost", "GET", "/service-types/{service-type}/hosts/{host}/bindings", handlers.BindingListAllByServiceTypeAndHost, true},
	{"authMethod:ListAll", "GET", "/authm", handlers.AuthMethodListAll, true},
	{"bindings:create", "POST", "/bindings/{name}", handlers.BindingCreate, true},
	{"bindings:ListAll", "GET", "/bindings", handlers.BindingListAll, true},
	{"bindings:update", "PUT", "/bindings/{name}", handlers.BindingUpdate, true},
	{"bindings:ListOneByName", "GET", "/bindings/{name}", handlers.BindingListOneByName, true},
	{"bindings:delete", "DELETE", "/bindings/{name}", handlers.BindingDelete, true},
	{"auth:dn", "GET", "/service-types/{service-type}/hosts/{host}:authx509", handlers.AuthViaCert, false},
}

Functions

This section is empty.

Types

type API

type API struct {
	Router *mux.Router // router Object reference
	Routes []APIRoute  // routes definitions list
}

API Object that holds routing information and the router itself

func NewRouting

func NewRouting(routes []APIRoute, store stores.Store, config *config.Config) *API

NewRouting creates a new routing object including mux.Router and routes definitions

type APIRoute

type APIRoute struct {
	Name    string           // name of the route for description purposes
	Method  string           // GET, POST, PUT string literals
	Path    string           // API call path with urlVars included
	Handler http.HandlerFunc // Handler Function to be used
	Auth    bool             // whether or not it should use the auth handler
}

APIRoute Item describing an API route

Jump to

Keyboard shortcuts

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