proto

package
v3.0.0-...-335bb84 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgClientHello = iota
	MsgServerHello
)

Variables

View Source
var (
	ErrMsgTooLong           = errors.New("message too long")
	ErrUnsupportedProtocol  = errors.New("unsupported protocol")
	ErrIncompatiableVersion = errors.New("incompatible protocol version")
)
View Source
var (
	Type = mime.FormatMediaType(mimeType, map[string]string{"version": mimeVersion})
)

Functions

func Write

func Write(w io.Writer, rsp *Message) error

Types

type Message

type Message struct {
	Type     string `json:"type"`
	Msg      int    `json:"msgid"`
	PeerName string `json:"peername,omitempty"`
	Service  string `json:"service,omitempty"`
}

func Read

func Read(r io.Reader) (*Message, error)

func Roundtrip

func Roundtrip(conn net.Conn, req *Message) (*Message, error)

Jump to

Keyboard shortcuts

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