router

package
v0.0.0-...-41c7706 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MuxListen

func MuxListen(path string, port int, mux *http.ServeMux) error

func MuxListenTLS

func MuxListenTLS(path string, port int, cert string, key string, mux *http.ServeMux) error

Types

type Method

type Method struct {
	Pattern string                                                  `json:"pattern"`
	Handler func(writer http.ResponseWriter, request *http.Request) `json:"handler"`
}

func MethodGenerator

func MethodGenerator(pattern string, handler func(writer http.ResponseWriter, request *http.Request)) Method

type Router

type Router struct {
	Name    string   `json:"name"`
	Mask    string   `json:"mask"`
	Methods []Method `json:"methods"`
}

type Server

type Server struct {
	Path     string   `json:"path"`
	Port     int      `json:"port"`
	Mask     string   `json:"mask"`
	CertPath string   `json:"certPath"`
	KeyPath  string   `json:"keyPath"`
	Routers  []Router `json:"routers"`
}

func (Server) Listen

func (server Server) Listen()

func (Server) ListenTLS

func (server Server) ListenTLS()

Jump to

Keyboard shortcuts

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