jsonrpc

package
v0.0.0-...-a8208a1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2022 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Handle = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
	switch r.Method {
	case "POST":
		ch := make(chan error, 1)
		conn := &struct {
			io.ReadCloser
			io.Writer
		}{r.Body, w}
		rpc.ServeCodec(&scodec{ch, org.NewServerCodec(conn)})
		<-ch
	default:
		w.Header().Set("Content-Type", "text/plain; charset=utf-8")
		w.WriteHeader(http.StatusMethodNotAllowed)
		io.WriteString(w, "405 POST only\n")
	}
})

Handle ...

Functions

func Dial

func Dial(endpoint string) *rpc.Client

Dial ...

Types

type Client

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

Client ...

func NewClient

func NewClient(endpoint string) *Client

NewClient ...

func (*Client) Call

func (c *Client) Call(serviceMethod string, args interface{}, reply interface{}) error

Call ...

func (*Client) Close

func (c *Client) Close() error

Close ...

func (*Client) Go

func (c *Client) Go(serviceMethod string, args interface{}, reply interface{}, done chan *rpc.Call) *rpc.Call

Go ...

Jump to

Keyboard shortcuts

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