streamprotoc

package
v0.0.0-...-11d1ae0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const MZ1 = 12444583056938131134
View Source
const MZ2 = 7945676850369339463

Variables

View Source
var EAgain = errors.New("Ooops, try again")
View Source
var ETimeout = errors.New("Deadline timed out")

Functions

func DecodeMessage

func DecodeMessage(tr *textproto.Reader, msg Message) error

func EncodeMessage

func EncodeMessage(tw *textproto.Writer, msg Message) error

Types

type Client

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

func NewClient

func NewClient(c net.Conn) *Client

func (*Client) DoDeadline

func (c *Client) DoDeadline(req, resp Message, dl time.Time) error

func (*Client) ReadMsg

func (c *Client) ReadMsg(r *bufio.Reader) error

Don't call this method directly!

func (*Client) WriteMsg

func (c *Client) WriteMsg(w *bufio.Writer) error

Don't call this method!

type Message

type Message interface {
	WriteMsg(w *bufio.Writer) error
	ReadMsg(r *bufio.Reader) error
}

type SendMessage

type SendMessage struct {
	Inner  Message
	ConnID uint64
	ReqID  uint64
}

func (*SendMessage) ReadMsg

func (s *SendMessage) ReadMsg(r *bufio.Reader) error

func (*SendMessage) WriteMsg

func (s *SendMessage) WriteMsg(w *bufio.Writer) error

type Server

type Server struct {
	NewMessage func() *SendMessage
	Handler    func(r *SendMessage, c *ServerConn)
}

func (*Server) Handle

func (s *Server) Handle(c net.Conn)

type ServerConn

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

func (*ServerConn) WriteMessage

func (c *ServerConn) WriteMessage(msg *SendMessage) error

Jump to

Keyboard shortcuts

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