httpmux

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDialerClosed = errors.New(`dialer already closed`)

Functions

func ConnectHttp

func ConnectHttp(ctx context.Context, client *http.Client, method, url string, header http.Header) (conn net.Conn, e error)

Types

type ApiHandler

type ApiHandler struct {
	Method  []string
	Path    string
	Handler http.HandlerFunc
}

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type ServeMux

type ServeMux struct {
	// contains filtered or unexported fields
}

func New

func New(log *slog.Logger) *ServeMux

func (*ServeMux) Delete

func (mux *ServeMux) Delete(pattern string, handler http.HandlerFunc)

func (*ServeMux) Get

func (mux *ServeMux) Get(pattern string, handler http.HandlerFunc)

func (*ServeMux) Head

func (mux *ServeMux) Head(pattern string, handler http.HandlerFunc)

func (*ServeMux) Patch

func (mux *ServeMux) Patch(pattern string, handler http.HandlerFunc)

func (*ServeMux) Post

func (mux *ServeMux) Post(pattern string, handler http.HandlerFunc)

func (*ServeMux) Put

func (mux *ServeMux) Put(pattern string, handler http.HandlerFunc)

func (*ServeMux) ServeHTTP

func (mux *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request)

type WebsocketConn

type WebsocketConn struct {
	// contains filtered or unexported fields
}

func NewWebsocketConn

func NewWebsocketConn(ws *websocket.Conn) *WebsocketConn

func (*WebsocketConn) Close

func (w *WebsocketConn) Close() error

func (*WebsocketConn) LocalAddr

func (w *WebsocketConn) LocalAddr() net.Addr

func (*WebsocketConn) Read

func (w *WebsocketConn) Read(b []byte) (n int, e error)

func (*WebsocketConn) RemoteAddr

func (w *WebsocketConn) RemoteAddr() net.Addr

func (*WebsocketConn) SetDeadline

func (w *WebsocketConn) SetDeadline(t time.Time) error

func (*WebsocketConn) SetReadDeadline

func (w *WebsocketConn) SetReadDeadline(t time.Time) error

func (*WebsocketConn) SetWriteDeadline

func (w *WebsocketConn) SetWriteDeadline(t time.Time) error

func (*WebsocketConn) Websocket

func (w *WebsocketConn) Websocket() *websocket.Conn

func (*WebsocketConn) Write

func (w *WebsocketConn) Write(b []byte) (n int, e error)

Jump to

Keyboard shortcuts

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