Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

router

v0.0.0-20221221104012-6e392965653d
github.com/AthenZ/garm/router

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

5 matches

Top ↑

Package router routes HTTP requests to corresponding handler. The authenticate request is defined as path "/authn" and only accept HTTP POST request. The authorization request is defined as path "/authz" and only accept HTTP POST request.

Functions

New

func New(cfg config.Server, h handler.Handler) *http.ServeMux

New returns ServeMux with routes using given handler.

Types

Route

type Route struct {
	Name        string
	Methods     []string
	Pattern     string
	HandlerFunc handler.Func
}

Route represents the routing information from incoming request.

NewRoutes

func NewRoutes(h handler.Handler) []Route

NewRoutes returns routes defined for handling authenticate and authorize requests. The authenticate requests will accept for only HTTP POST requests, and the endpoint is /authn. The authorize requests will accept for only HTTP POST requests, and the endpoint is /authz.

Dependency graph