http

package
v0.0.0-...-a2ce4e4 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoResult = errors.New("no result in JSON-RPC response")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	api.ClientAdapter
	// contains filtered or unexported fields
}

func Dial

func Dial(rawUrl string, opt api.ClientOption) (*Client, error)

func (*Client) BatchCallJsonRpc

func (c *Client) BatchCallJsonRpc(b []api.BatchElem) error

func (*Client) CallJsonRpc

func (c *Client) CallJsonRpc(result interface{}, method string, args interface{}) error

func (*Client) GetType

func (c *Client) GetType() api.ClientType

func (*Client) RawCallHttp

func (c *Client) RawCallHttp(method string, path string, body interface{}) (int, io.ReadCloser, error)

type Context

type Context struct {
	ctx.ContextAdapter
	// contains filtered or unexported fields
}

func (*Context) ClientIP

func (ctx *Context) ClientIP() string

type RawContext

type RawContext struct {
	Context
}

func (*RawContext) Param

func (r *RawContext) Param(key string) string

func (*RawContext) Query

func (r *RawContext) Query(key string) string

func (*RawContext) WriteData

func (r *RawContext) WriteData(code int, contType string, data []byte) error

type Server

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

func NewServer

func NewServer(option api.ServerOption) *Server

func (*Server) RegisterJsonRPC

func (s *Server) RegisterJsonRPC(name string, receiver interface{}) error

func (*Server) RegisterPath

func (s *Server) RegisterPath(httpMethod string, path string, handle api.RawHttpHandle) error

func (*Server) RegisterRawWs

func (s *Server) RegisterRawWs(handle api.RawWsHandle) error

func (*Server) Run

func (s *Server) Run(ln net.Listener) error

Jump to

Keyboard shortcuts

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