gateway

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBodyWriter added in v0.8.5

func NewBodyWriter() *bodyWriter

Types

type BodyWriter added in v0.8.5

type BodyWriter interface {
	Write(data []byte)
	WriteProto(p proto.Message) error
}

BodyWriter is implemented by bodyWriter internally. This interface is used by the developer to write desired output to the REST http response. WriteProto is a helper function for marshalling and then writing the proto message to the body of http response.

type CloseHandler

type CloseHandler = func(c rony.Conn)

type ConnectHandler

type ConnectHandler = func(c rony.Conn, kvs ...*rony.KeyValue)

type Gateway

type Gateway interface {
	Start()
	Run()
	Shutdown()
	GetConn(connID uint64) rony.Conn
	Addr() []string
	Protocol() Protocol
}

Gateway defines the gateway interface where clients could connect and communicate with the edge server

type HeaderWriter added in v0.8.5

type HeaderWriter map[string]string

HeaderWriter is the object responsible for writing response header.

func NewHeaderWriter added in v0.8.5

func NewHeaderWriter() *HeaderWriter

func (HeaderWriter) Release added in v0.8.5

func (hw HeaderWriter) Release()

func (HeaderWriter) Set added in v0.8.5

func (hw HeaderWriter) Set(key, value string)

type MessageHandler

type MessageHandler = func(c rony.Conn, streamID int64, data []byte, bypass bool)

type Protocol

type Protocol int32
const (
	Undefined Protocol = 0
	Dummy     Protocol = 1 << iota
	Http
	Websocket
	Quic
	Grpc
	TCP = Http | Websocket // Http & Websocket
)

func (Protocol) String

func (p Protocol) String() string

type ProxyFactory added in v0.6.40

type ProxyFactory interface {
	Get() ProxyHandle
}

ProxyFactory is the factory which generates ProxyHandle.

type ProxyHandle added in v0.6.1

type ProxyHandle interface {
	OnRequest(conn rony.Conn, ctx *RequestCtx) []byte
	OnResponse(data []byte, bodyWriter BodyWriter, hdrWriter *HeaderWriter)
	Release()
}

ProxyHandle defines the interface for proxy handlers. This is used in 'rest' package to support writing restfull wrappers for the RPC handlers.

type RequestCtx added in v0.5.23

type RequestCtx = fasthttp.RequestCtx

Directories

Path Synopsis
tcp
util
Package wsutil provides utilities for working with WebSocket protocol.
Package wsutil provides utilities for working with WebSocket protocol.

Jump to

Keyboard shortcuts

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