Documentation ¶
Index ¶
- Constants
- Variables
- func NewClientConnection(sourceAddr net.Addr, connectTimeout time.Duration, ...) types.ClientConnection
- func NewListener(lc *v2.Listener) types.Listener
- func NewRequestInfo() types.RequestInfo
- func NewServerConnection(ctx context.Context, rawc net.Conn, stopChan chan struct{}) types.Connection
- func RegisterNewPoolFactory(protocol types.Protocol, factory connNewPool)
- func SetTransferTimeout(time time.Duration)
- func TransferServer(handler types.ConnectionHandler)
- type ListenerState
- type RequestInfo
- func (r *RequestInfo) BytesReceived() uint64
- func (r *RequestInfo) BytesSent() uint64
- func (r *RequestInfo) DownstreamLocalAddress() net.Addr
- func (r *RequestInfo) DownstreamRemoteAddress() net.Addr
- func (r *RequestInfo) Duration() time.Duration
- func (r *RequestInfo) GetResponseFlag(flag types.ResponseFlag) bool
- func (r *RequestInfo) IsHealthCheck() bool
- func (r *RequestInfo) OnUpstreamHostSelected(host types.HostInfo)
- func (r *RequestInfo) Protocol() types.Protocol
- func (r *RequestInfo) RequestFinishedDuration() time.Duration
- func (r *RequestInfo) RequestReceivedDuration() time.Duration
- func (r *RequestInfo) ResponseCode() int
- func (r *RequestInfo) ResponseReceivedDuration() time.Duration
- func (r *RequestInfo) RouteEntry() types.RouteRule
- func (r *RequestInfo) SetBytesReceived(bytesReceived uint64)
- func (r *RequestInfo) SetBytesSent(bytesSent uint64)
- func (r *RequestInfo) SetDownstreamLocalAddress(addr net.Addr)
- func (r *RequestInfo) SetDownstreamRemoteAddress(addr net.Addr)
- func (r *RequestInfo) SetHealthCheck(isHc bool)
- func (r *RequestInfo) SetRequestFinishedDuration(t time.Time)
- func (r *RequestInfo) SetRequestReceivedDuration(t time.Time)
- func (r *RequestInfo) SetResponseCode(code int)
- func (r *RequestInfo) SetResponseFlag(flag types.ResponseFlag)
- func (r *RequestInfo) SetResponseReceivedDuration(t time.Time)
- func (r *RequestInfo) SetRouteEntry(routerRule types.RouteRule)
- func (r *RequestInfo) SetStartTime()
- func (r *RequestInfo) SetUpstreamLocalAddress(addr string)
- func (r *RequestInfo) StartTime() time.Time
- func (r *RequestInfo) UpstreamHost() types.HostInfo
- func (r *RequestInfo) UpstreamLocalAddress() string
Constants ¶
View Source
const ( DefaultBufferReadCapacity = 1 << 7 NetBufferDefaultSize = 0 NetBufferDefaultCapacity = 1 << 4 DefaultIdleTimeout = 90 * time.Second DefaultConnectTimeout = 3 * time.Second )
Network related const
Variables ¶
View Source
var ConnNewPoolFactories map[types.Protocol]connNewPool
View Source
var TransferTimeout = time.Second * 30 //default 30s
TransferTimeout is the total transfer time
View Source
var ( // UseNetpollMode indicates which mode should be used for connection IO processing UseNetpollMode = false )
Functions ¶
func NewClientConnection ¶
func NewClientConnection(sourceAddr net.Addr, connectTimeout time.Duration, tlsMng types.TLSContextManager, remoteAddr net.Addr, stopChan chan struct{}) types.ClientConnection
NewClientConnection new client-side connection
func NewServerConnection ¶
func NewServerConnection(ctx context.Context, rawc net.Conn, stopChan chan struct{}) types.Connection
NewServerConnection new server-side connection, rawc is the raw connection from go/net
func RegisterNewPoolFactory ¶
func SetTransferTimeout ¶
func TransferServer ¶
func TransferServer(handler types.ConnectionHandler)
TransferServer is called on new mosn start
Types ¶
type ListenerState ¶
type ListenerState int
const ( ListenerInited ListenerState = iota ListenerRunning ListenerStopped )
listener state ListenerInited means listener is inited, a inited listener can be started or stopped ListenerRunning means listener is running, start a running listener will be ignored. ListenerStopped means listener is stopped, start a stopped listener without restart flag will be ignored.
type RequestInfo ¶
type RequestInfo struct {
// contains filtered or unexported fields
}
RequestInfo
func (*RequestInfo) BytesReceived ¶
func (r *RequestInfo) BytesReceived() uint64
func (*RequestInfo) BytesSent ¶
func (r *RequestInfo) BytesSent() uint64
func (*RequestInfo) DownstreamLocalAddress ¶
func (r *RequestInfo) DownstreamLocalAddress() net.Addr
func (*RequestInfo) DownstreamRemoteAddress ¶
func (r *RequestInfo) DownstreamRemoteAddress() net.Addr
func (*RequestInfo) Duration ¶
func (r *RequestInfo) Duration() time.Duration
func (*RequestInfo) GetResponseFlag ¶
func (r *RequestInfo) GetResponseFlag(flag types.ResponseFlag) bool
func (*RequestInfo) IsHealthCheck ¶
func (r *RequestInfo) IsHealthCheck() bool
func (*RequestInfo) OnUpstreamHostSelected ¶
func (r *RequestInfo) OnUpstreamHostSelected(host types.HostInfo)
func (*RequestInfo) Protocol ¶
func (r *RequestInfo) Protocol() types.Protocol
func (*RequestInfo) RequestFinishedDuration ¶
func (r *RequestInfo) RequestFinishedDuration() time.Duration
func (*RequestInfo) RequestReceivedDuration ¶
func (r *RequestInfo) RequestReceivedDuration() time.Duration
func (*RequestInfo) ResponseCode ¶
func (r *RequestInfo) ResponseCode() int
func (*RequestInfo) ResponseReceivedDuration ¶
func (r *RequestInfo) ResponseReceivedDuration() time.Duration
func (*RequestInfo) RouteEntry ¶
func (r *RequestInfo) RouteEntry() types.RouteRule
func (*RequestInfo) SetBytesReceived ¶
func (r *RequestInfo) SetBytesReceived(bytesReceived uint64)
func (*RequestInfo) SetBytesSent ¶
func (r *RequestInfo) SetBytesSent(bytesSent uint64)
func (*RequestInfo) SetDownstreamLocalAddress ¶
func (r *RequestInfo) SetDownstreamLocalAddress(addr net.Addr)
func (*RequestInfo) SetDownstreamRemoteAddress ¶
func (r *RequestInfo) SetDownstreamRemoteAddress(addr net.Addr)
func (*RequestInfo) SetHealthCheck ¶
func (r *RequestInfo) SetHealthCheck(isHc bool)
func (*RequestInfo) SetRequestFinishedDuration ¶
func (r *RequestInfo) SetRequestFinishedDuration(t time.Time)
func (*RequestInfo) SetRequestReceivedDuration ¶
func (r *RequestInfo) SetRequestReceivedDuration(t time.Time)
func (*RequestInfo) SetResponseCode ¶
func (r *RequestInfo) SetResponseCode(code int)
func (*RequestInfo) SetResponseFlag ¶
func (r *RequestInfo) SetResponseFlag(flag types.ResponseFlag)
func (*RequestInfo) SetResponseReceivedDuration ¶
func (r *RequestInfo) SetResponseReceivedDuration(t time.Time)
func (*RequestInfo) SetRouteEntry ¶
func (r *RequestInfo) SetRouteEntry(routerRule types.RouteRule)
func (*RequestInfo) SetStartTime ¶
func (r *RequestInfo) SetStartTime()
func (*RequestInfo) SetUpstreamLocalAddress ¶
func (r *RequestInfo) SetUpstreamLocalAddress(addr string)
func (*RequestInfo) StartTime ¶
func (r *RequestInfo) StartTime() time.Time
func (*RequestInfo) UpstreamHost ¶
func (r *RequestInfo) UpstreamHost() types.HostInfo
func (*RequestInfo) UpstreamLocalAddress ¶
func (r *RequestInfo) UpstreamLocalAddress() string
Click to show internal directories.
Click to hide internal directories.