codecs

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2025 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.

Source Files

  • codecs.go
  • dialer.go
  • init.go
  • registry.go

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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