codecs

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: Unlicense Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSchemeNotSupported = errors.New("url scheme not supported")
View Source
var HttpHandler = http.HttpHandler
View Source
var HttpWebsocketHandler = func(srv *server.Server, origins []string) gohttp.Handler {
	cwss := WebsocketHandler(srv, origins)
	chttp := HttpHandler(srv)
	return gohttp.HandlerFunc(func(w gohttp.ResponseWriter, r *gohttp.Request) {
		if r.Header.Get("upgrade") != "" {
			cwss.ServeHTTP(w, r)
			return
		}
		chttp.ServeHTTP(w, r)
	})
}
View Source
var WebsocketHandler = websocket.WebsocketHandler

Functions

func Dial

func Dial(u string) (jsonrpc.Conn, error)

func DialContext

func DialContext(ctx context.Context, u string) (jsonrpc.Conn, error)

func ListenAndServe added in v0.2.23

func ListenAndServe(u string, srv *server.Server, opts map[string]any) error

ListenAndServe

func RegisterDialer added in v0.2.23

func RegisterDialer(fn dialerFunc, names ...string)

func RegisterHandler added in v0.2.23

func RegisterHandler(fn handlerFunc, names ...string)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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