Documentation ¶
Index ¶
- Constants
- Variables
- func DelUDPProxyMap(key string)
- func GetProxyMapKey(raddr, laddr string) string
- func NewClientConnection(connectTimeout time.Duration, tlsMng types.TLSClientContextManager, ...) types.ClientConnection
- func NewFilterManager(conn api.Connection) api.FilterManager
- func NewListener(lc *v2.Listener) types.Listener
- func NewRequestInfo() api.RequestInfo
- func NewServerConnection(ctx context.Context, rawc net.Conn, stopChan chan struct{}) api.Connection
- func RegisterClientConnFactory(factory ClientConnFactory)
- func RegisterListenerFactory(factory ListenerFactory)
- func RegisterServerConnFactory(factory ServerConnFactory)
- func SetNetpollMode(enable bool)
- func SetTransferTimeout(time time.Duration)
- func SetUDPProxyMap(key string, conn api.Connection)
- func TransferServer(handler types.ConnectionHandler)
- type ClientConnFactory
- type DnsResolver
- type DnsResponse
- type ListenerFactory
- 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 api.ResponseFlag) bool
- func (r *RequestInfo) GetResponseFlagResult() string
- func (r *RequestInfo) IsHealthCheck() bool
- func (r *RequestInfo) OnUpstreamHostSelected(host api.HostInfo)
- func (r *RequestInfo) ProcessTimeDuration() time.Duration
- func (r *RequestInfo) Protocol() api.ProtocolName
- 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() api.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) SetProcessTimeDuration(d time.Duration)
- func (r *RequestInfo) SetProtocol(p api.ProtocolName)
- 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 api.ResponseFlag)
- func (r *RequestInfo) SetResponseReceivedDuration(t time.Time)
- func (r *RequestInfo) SetRouteEntry(routerRule api.RouteRule)
- func (r *RequestInfo) SetStartTime()
- func (r *RequestInfo) SetUpstreamLocalAddress(addr string)
- func (r *RequestInfo) StartTime() time.Time
- func (r *RequestInfo) UpstreamHost() api.HostInfo
- func (r *RequestInfo) UpstreamLocalAddress() string
- type ServerConnFactory
Constants ¶
const ( DefaultReadBufferSize = 1 << 7 NetBufferDefaultSize = 0 NetBufferDefaultCapacity = 1 << 4 DefaultConnectTimeout = 10 * time.Second )
Network related const
const ( SO_MARK = 0x24 SOL_IP = 0x0 IP_TRANSPARENT = 0x13 )
const UdpPacketMaxSize = 64 * 1024
Variables ¶
var DefaultResolverFile string = "/etc/resolv.conf"
var (
ProxyMap = sync.Map{}
)
var TransferTimeout = time.Second * 30 //default 30s
TransferTimeout is the total transfer time
var ( // UseNetpollMode indicates which mode should be used for connection IO processing UseNetpollMode = false )
Functions ¶
func DelUDPProxyMap ¶ added in v0.15.0
func DelUDPProxyMap(key string)
func GetProxyMapKey ¶ added in v0.15.0
func NewClientConnection ¶
func NewClientConnection(connectTimeout time.Duration, tlsMng types.TLSClientContextManager, remoteAddr net.Addr, stopChan chan struct{}) types.ClientConnection
NewClientConnection new client-side connection
func NewFilterManager ¶ added in v0.25.0
func NewFilterManager(conn api.Connection) api.FilterManager
func NewServerConnection ¶
NewServerConnection new server-side connection, rawc is the raw connection from go/net
func RegisterClientConnFactory ¶ added in v0.25.0
func RegisterClientConnFactory(factory ClientConnFactory)
func RegisterListenerFactory ¶ added in v0.27.0
func RegisterListenerFactory(factory ListenerFactory)
func RegisterServerConnFactory ¶ added in v0.27.0
func RegisterServerConnFactory(factory ServerConnFactory)
func SetNetpollMode ¶ added in v0.20.0
func SetNetpollMode(enable bool)
SetNetpollMode set the netpoll mode
func SetTransferTimeout ¶
func SetUDPProxyMap ¶ added in v0.15.0
func SetUDPProxyMap(key string, conn api.Connection)
func TransferServer ¶
func TransferServer(handler types.ConnectionHandler)
TransferServer is called on new mosn start
Types ¶
type ClientConnFactory ¶ added in v0.25.0
type ClientConnFactory func(connectTimeout time.Duration, tlsMng types.TLSClientContextManager, remoteAddr net.Addr, stopChan chan struct{}) types.ClientConnection
Factory function for creating client side connection.
func GetClientConnFactory ¶ added in v0.27.0
func GetClientConnFactory() ClientConnFactory
type DnsResolver ¶ added in v0.13.0
type DnsResolver struct {
// contains filtered or unexported fields
}
func NewDnsResolver ¶ added in v0.13.0
func NewDnsResolver(config *v2.DnsResolverConfig) *DnsResolver
func NewDnsResolverFromFile ¶ added in v0.13.0
func NewDnsResolverFromFile(configFile string, resolverPort string) *DnsResolver
func (*DnsResolver) DnsResolve ¶ added in v0.13.0
func (dr *DnsResolver) DnsResolve(dnsAddr string, dnsLookupFamily v2.DnsLookupFamily) *[]DnsResponse
type DnsResponse ¶ added in v0.13.0
type ListenerFactory ¶ added in v0.27.0
Factory function for creating mosn listener.
func GetListenerFactory ¶ added in v0.27.0
func GetListenerFactory() ListenerFactory
type ListenerState ¶
type ListenerState int
const ( ListenerInited ListenerState = iota ListenerRunning ListenerStopped ListenerClosed )
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. ListenerClosed means listener is closed, start a closed 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 api.ResponseFlag) bool
func (*RequestInfo) GetResponseFlagResult ¶ added in v0.19.0
func (r *RequestInfo) GetResponseFlagResult() string
func (*RequestInfo) IsHealthCheck ¶
func (r *RequestInfo) IsHealthCheck() bool
func (*RequestInfo) OnUpstreamHostSelected ¶
func (r *RequestInfo) OnUpstreamHostSelected(host api.HostInfo)
func (*RequestInfo) ProcessTimeDuration ¶
func (r *RequestInfo) ProcessTimeDuration() time.Duration
func (*RequestInfo) Protocol ¶
func (r *RequestInfo) Protocol() api.ProtocolName
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() api.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) SetProcessTimeDuration ¶
func (r *RequestInfo) SetProcessTimeDuration(d time.Duration)
func (*RequestInfo) SetProtocol ¶ added in v0.12.0
func (r *RequestInfo) SetProtocol(p api.ProtocolName)
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 api.ResponseFlag)
func (*RequestInfo) SetResponseReceivedDuration ¶
func (r *RequestInfo) SetResponseReceivedDuration(t time.Time)
func (*RequestInfo) SetRouteEntry ¶
func (r *RequestInfo) SetRouteEntry(routerRule api.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() api.HostInfo
func (*RequestInfo) UpstreamLocalAddress ¶
func (r *RequestInfo) UpstreamLocalAddress() string
type ServerConnFactory ¶ added in v0.27.0
type ServerConnFactory func(ctx context.Context, rawc net.Conn, stopChan chan struct{}) api.Connection
Factory function for creating server side connection.
func GetServerConnFactory ¶ added in v0.27.0
func GetServerConnFactory() ServerConnFactory