dummyGateway

package
v0.16.18 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Exposer func(gw *Gateway)
}

type Conn

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

func NewConn added in v0.12.11

func NewConn(id uint64) *Conn

func (*Conn) Body added in v0.10.0

func (c *Conn) Body() []byte

func (*Conn) ClientIP

func (c *Conn) ClientIP() string

func (*Conn) ConnID

func (c *Conn) ConnID() uint64

func (*Conn) Get

func (c *Conn) Get(key string) interface{}

func (*Conn) Method added in v0.10.0

func (c *Conn) Method() string

func (*Conn) MultiPart added in v0.10.0

func (c *Conn) MultiPart() (*multipart.Form, error)

func (*Conn) Path added in v0.10.0

func (c *Conn) Path() string

func (*Conn) Persistent

func (c *Conn) Persistent() bool

func (*Conn) ReadHeader added in v0.14.25

func (c *Conn) ReadHeader(key string) string

func (*Conn) Redirect added in v0.12.32

func (c *Conn) Redirect(statusCode int, newHostPort string)

func (*Conn) RedirectURL added in v0.16.11

func (c *Conn) RedirectURL(statusCode int, url string)

func (*Conn) Set

func (c *Conn) Set(key string, val interface{})

func (*Conn) SetPersistent

func (c *Conn) SetPersistent(b bool) *Conn

func (*Conn) Walk added in v0.16.16

func (c *Conn) Walk(f func(k string, v interface{}) bool)

func (*Conn) WithHandler added in v0.14.27

func (c *Conn) WithHandler(onMessage func(connID uint64, streamID int64, data []byte, hdr map[string]string)) *Conn

func (*Conn) WriteBinary added in v0.10.0

func (c *Conn) WriteBinary(streamID int64, data []byte) error

func (*Conn) WriteHeader added in v0.10.0

func (c *Conn) WriteHeader(key, value string)

func (*Conn) WriteStatus added in v0.10.5

func (c *Conn) WriteStatus(status int)

type Gateway

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

func New

func New(config Config) (*Gateway, error)

func (*Gateway) Addr

func (g *Gateway) Addr() []string

func (*Gateway) CloseConn

func (g *Gateway) CloseConn(connID uint64)

CloseConn closed the connection

func (*Gateway) GetConn

func (g *Gateway) GetConn(connID uint64) rony.Conn

func (*Gateway) OpenConn

func (g *Gateway) OpenConn(
	connID uint64, persistent bool,
	onReceiveMessage func(connID uint64, streamID int64, data []byte),
	hdr ...*rony.KeyValue,
)

OpenConn opens a persistent connection to the gateway. For short-lived use RPC or REST methods.

func (*Gateway) Protocol added in v0.7.2

func (g *Gateway) Protocol() rony.GatewayProtocol

func (*Gateway) REST added in v0.10.0

func (g *Gateway) REST(
	connID uint64, method, path string,
	body []byte,
	kvs ...*rony.KeyValue,
) (respBody []byte, respHdr map[string]string)

REST emulates a Http REST request.

func (*Gateway) RPC added in v0.10.0

func (g *Gateway) RPC(connID uint64, streamID int64, data []byte) error

RPC emulates sending an RPC command to the connection. It opens a non-persistent connection if connID does not exist

func (*Gateway) Run

func (g *Gateway) Run()

func (*Gateway) Shutdown

func (g *Gateway) Shutdown()

func (*Gateway) Start

func (g *Gateway) Start()

func (*Gateway) Subscribe added in v0.16.0

func (g *Gateway) Subscribe(d rony.GatewayDelegate)

Jump to

Keyboard shortcuts

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