codecs

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Unlicense Imports: 11 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 jsonrpc.Handler, 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 jsonrpc.Handler, 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