simplehttp

package
v0.3.1-rc.11 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFrontMapping

func GetFrontMapping() map[string]bool

func Httpserver

func Httpserver(o HttpServerOption)

func MarshalProtoAndWrite

func MarshalProtoAndWrite(w http.ResponseWriter, data proto.Message) error

func UnmarshalProtoFromRequest

func UnmarshalProtoFromRequest(r *http.Request, data proto.Message) error

func WhenNoError

func WhenNoError[T any](t T, err error) *wne[T]

Types

type Handler

type Handler map[string]map[string]func(http.ResponseWriter, *http.Request) error

func (Handler) Handle

func (h Handler) Handle(method, pattern string, handler func(http.ResponseWriter, *http.Request) error)

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) CloseConn

func (c *HttpServerOption) CloseConn(w http.ResponseWriter, r *http.Request) error

func (*HttpServerOption) ConnWebsocket

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

func (*HttpServerOption) DeleteNode

func (n *HttpServerOption) DeleteNode(w http.ResponseWriter, r *http.Request) error

func (*HttpServerOption) DeleteTag

func (t *HttpServerOption) DeleteTag(w http.ResponseWriter, r *http.Request) error

func (*HttpServerOption) GetConfig

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

func (*HttpServerOption) GetLatency

func (l *HttpServerOption) GetLatency(w http.ResponseWriter, r *http.Request) error
func (s *HttpServerOption) GetLinkList(w http.ResponseWriter, r *http.Request) error

func (*HttpServerOption) GetNode

func (*HttpServerOption) Manager

func (*HttpServerOption) NodeNow

func (s *HttpServerOption) PatchLink(w http.ResponseWriter, r *http.Request) error

func (*HttpServerOption) Routers

func (o *HttpServerOption) Routers() Handler

func (*HttpServerOption) SaveBypass

func (n *HttpServerOption) SaveBypass(w http.ResponseWriter, r *http.Request) error

func (*HttpServerOption) SaveConfig

func (c *HttpServerOption) SaveConfig(w http.ResponseWriter, r *http.Request) error

func (*HttpServerOption) SaveNode

func (*HttpServerOption) SaveTag

func (*HttpServerOption) UseNode

Jump to

Keyboard shortcuts

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