streamhttp

package
v0.0.0-...-aaf6028 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Deprecated: Considered cruft right now.

HTTP over StreamProto over KCP-Go.

This package has some subtle bugs and resource leaks, and is not considered Stable right now.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMessage

func NewMessage() *streamprotoc.SendMessage

Types

type Client

type Client struct {
	Inner *streamprotoc.Client
}

func Dial

func Dial(addr string) (*Client, error)

Dials with kcp-go

func DialTCP

func DialTCP(addr string) (*Client, error)

Dials with TCP

func (*Client) DoDeadline

func (c *Client) DoDeadline(req *fasthttp.Request, resp *fasthttp.Response, deadline time.Time) error

type Server

type Server struct {
	streamprotoc.Server
}

func NewServer

func NewServer(hnd fasthttp.RequestHandler) *Server

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(addr string) error

func (*Server) ListenAndServeTCP

func (s *Server) ListenAndServeTCP(addr string) error

func (*Server) Serve

func (s *Server) Serve(l net.Listener)

type WrappedCtx

type WrappedCtx struct {
	Ctx fasthttp.RequestCtx
}

func (*WrappedCtx) ReadMsg

func (wc *WrappedCtx) ReadMsg(r *bufio.Reader) error

func (*WrappedCtx) WriteMsg

func (wc *WrappedCtx) WriteMsg(w *bufio.Writer) error

type WrappedRequest

type WrappedRequest struct {
	Req *fasthttp.Request
}

func (*WrappedRequest) ReadMsg

func (wc *WrappedRequest) ReadMsg(r *bufio.Reader) error

func (*WrappedRequest) WriteMsg

func (wc *WrappedRequest) WriteMsg(w *bufio.Writer) error

type WrappedResponse

type WrappedResponse struct {
	Resp *fasthttp.Response
}

func (*WrappedResponse) ReadMsg

func (wc *WrappedResponse) ReadMsg(r *bufio.Reader) error

func (*WrappedResponse) WriteMsg

func (wc *WrappedResponse) WriteMsg(w *bufio.Writer) error

Jump to

Keyboard shortcuts

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