pbqp

package module
v0.0.0-...-6c3abbd Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2019 License: Apache-2.0 Imports: 7 Imported by: 2

README

pbqp

PBQP(Protobuf Quick Protocol), the simple protocol based on Protobuf with SMUX

Great-Ghost Protocol(s) 幽灵计划协议族

链路层
  • 实现于:gnode

  • RSH 远程终端协议

  • CABLE 幽灵链路协议

网络层
  • 实现于:gnet

  • ARP 地址解析协议

  • DHCP 动态主机设置协议

传输层
  • 实现于:gnet

  • TCP

  • UDP

  • P2P

应用层
  • 实现于:gnet

  • PROXY 代理协议

Documentation

Index

Constants

View Source
const (
	Version = "0.0.1"
)

raw

Variables

View Source
var (
	ErrIsClosed = errors.New("Mux Tunnel is Closed")
)

error(s)

Functions

func BStoI64

func BStoI64(bs []byte) int64

BStoI64 Util

func I64toBS

func I64toBS(n int64) []byte

I64toBS Util

func Read

func Read(r io.ReadWriter, pb proto.Message) error

Read from conn

func RootErr

func RootErr(e error) error

RootErr resolve

func Write

func Write(w io.ReadWriter, pb proto.Message) error

Write to conn

Types

type Builder

type Builder func(conn io.ReadWriteCloser, config *smux.Config) (*smux.Session, error)

Builder func of smux

type Chain

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

Chain for SMUX Action

func (*Chain) Finally

func (c *Chain) Finally() error

Finally Action

func (*Chain) Test

func (c *Chain) Test() error

Test return error in chain

func (*Chain) Then

func (c *Chain) Then(fn Handler) *Chain

Then Action

type Handler

type Handler func(proto.Message, net.Conn) (proto.Message, proto.Message, error)

Handler of Chain

func(readbuf, conn) (writebuf, next_readbuf, err)

func ReadOnce

func ReadOnce(next proto.Message) Handler

ReadOnce Action

func WriteOnce

func WriteOnce(pb proto.Message, next proto.Message) Handler

WriteOnce Action

type T

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

T Tunnel

func Client

func Client(conn net.Conn) (*T, error)

Client Side

func Server

func Server(conn net.Conn) (*T, error)

Server Side

func (*T) Accept

func (t *T) Accept() *Chain

Accept other-side

func (*T) Close

func (t *T) Close() error

Close T

func (*T) Open

func (t *T) Open() *Chain

Open other-side

Directories

Path Synopsis
tests
client command
server command

Jump to

Keyboard shortcuts

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