simplehttp

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFront

func GetFront() (http.Handler, map[string]bool)

func GrpcToHttp

func GrpcToHttp[req, resp proto.Message](function func(context.Context, req) (resp, error)) func(http.ResponseWriter, *http.Request) error

func Httpserver

func Httpserver(o HttpServerOption)

Types

type Handler

type Handler map[string]map[string]ServeHTTP

func (Handler) Handle

func (h Handler) Handle(method, pattern string, handler ServeHTTP)

func (Handler) ServeHTTP

func (h Handler) ServeHTTP(ow http.ResponseWriter, r *http.Request)

type HttpServerOption

type HttpServerOption struct {
	Mux         *http.ServeMux
	Shunt       *shunt.Shunt
	NodeServer  gn.NodeServer
	Subscribe   gn.SubscribeServer
	Tag         gn.TagServer
	Connections gs.ConnectionsServer
	Config      gc.ConfigServiceServer
	Tools       gt.ToolsServer
}

func (*HttpServerOption) ConnWebsocket

func (cc *HttpServerOption) ConnWebsocket(w http.ResponseWriter, r *http.Request) error

func (*HttpServerOption) Routers

func (o *HttpServerOption) Routers() Handler

type ServeHTTP

type ServeHTTP func(http.ResponseWriter, *http.Request) error

Jump to

Keyboard shortcuts

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