http

package
v0.0.0-...-c18a219 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Matcher

func Matcher(p rpc.ReadPeeker) bool

Matcher is an HTTP Matcher.

Types

type Builder

type Builder struct {
}

func (Builder) NewClient

func (Builder) NewClient(s rpc.Stream, opts data.Map) rpc.ClientCodec

func (Builder) NewServer

func (Builder) NewServer(s rpc.Stream, opts data.Map) rpc.ServerCodec

type ClientCodec

type ClientCodec struct {
	rpc.Stream
	// contains filtered or unexported fields
}

func (*ClientCodec) DecodeHead

func (c *ClientCodec) DecodeHead(head *rpc.ResponseHead) (err error)

func (*ClientCodec) DecodeResult

func (c *ClientCodec) DecodeResult(result *rpc.Result) error

func (*ClientCodec) DiscardResult

func (c *ClientCodec) DiscardResult() (err error)

func (*ClientCodec) Encode

func (c *ClientCodec) Encode(req *rpc.Request) (err error)

Encode send request to RPC server. For example

POST /Test.Hello HTTP/1.1
AUXO-RPC-ID: 5a3a470453d38640fa000001
Content-Length: 8

["auxo"]

type ServerCodec

type ServerCodec struct {
	rpc.Stream
	// contains filtered or unexported fields
}

func (*ServerCodec) DecodeArgs

func (c *ServerCodec) DecodeArgs(args []interface{}) error

func (*ServerCodec) DecodeHead

func (c *ServerCodec) DecodeHead(head *rpc.RequestHead) (err error)

func (*ServerCodec) DiscardArgs

func (c *ServerCodec) DiscardArgs() error

func (*ServerCodec) Encode

func (c *ServerCodec) Encode(resp *rpc.Response) (err error)

Encode send response to RPC client. For example

HTTP/1.1 200 OK Content-Length: 24 Auxo-Rpc-Id: 5a3a470453d38640fa000001 Connection: Keep-Alive Content-Type: application/json; charset=UTF-8 Date: Thu, 21 Dec 2017 11:18:52 CST Server: auxo-rpc

{"value":"Hello, auxo"}

Jump to

Keyboard shortcuts

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