Documentation
¶
Index ¶
- Variables
- func CreateServerStreamConnection(context context.Context, prot types.Protocol, connection types.Connection, ...) types.ServerStreamConnection
- func Register(prot types.Protocol, factory ProtocolStreamFactory)
- func SelectStreamFactoryProtocol(ctx context.Context, prot string, peek []byte) (types.Protocol, error)
- type BaseStream
- type Client
- type ContextManager
- type ProtocolStreamFactory
Constants ¶
This section is empty.
Variables ¶
View Source
var EAGAIN = errors.New("AGAIN")
View Source
var FAILED = errors.New("FAILED")
Functions ¶
func CreateServerStreamConnection ¶
func CreateServerStreamConnection(context context.Context, prot types.Protocol, connection types.Connection, callbacks types.ServerStreamConnectionEventListener) types.ServerStreamConnection
func Register ¶
func Register(prot types.Protocol, factory ProtocolStreamFactory)
Types ¶
type BaseStream ¶
func (*BaseStream) AddEventListener ¶
func (s *BaseStream) AddEventListener(streamCb types.StreamEventListener)
func (*BaseStream) DestroyStream ¶
func (s *BaseStream) DestroyStream()
func (*BaseStream) RemoveEventListener ¶
func (s *BaseStream) RemoveEventListener(streamCb types.StreamEventListener)
func (*BaseStream) ResetStream ¶
func (s *BaseStream) ResetStream(reason types.StreamResetReason)
type Client ¶
type Client interface {
types.ConnectionEventListener
types.ReadFilter
ConnID() uint64
Connect() error
ActiveRequestsNum() int
NewStream(context context.Context, respDecoder types.StreamReceiveListener) types.StreamSender
SetConnectionCollector(read, write metrics.Counter)
AddConnectionEventListener(listener types.ConnectionEventListener)
SetStreamConnectionEventListener(listener types.StreamConnectionEventListener)
Close()
}
func NewBiDirectStreamClient ¶
func NewBiDirectStreamClient(ctx context.Context, prot types.Protocol, connection types.ClientConnection, host types.HostInfo, serverCallbacks types.ServerStreamConnectionEventListener) Client
NewBiDirectStreamClient Create a bidirectional client used to realize bidirectional communication
type ContextManager ¶
type ContextManager struct {
// contains filtered or unexported fields
}
contextManager
func NewContextManager ¶
func NewContextManager(base context.Context) *ContextManager
func (*ContextManager) Get ¶
func (cm *ContextManager) Get() context.Context
func (*ContextManager) InjectTrace ¶
func (*ContextManager) Next ¶
func (cm *ContextManager) Next()
type ProtocolStreamFactory ¶
type ProtocolStreamFactory interface {
CreateClientStream(context context.Context, connection types.ClientConnection,
streamConnCallbacks types.StreamConnectionEventListener,
callbacks types.ConnectionEventListener) types.ClientStreamConnection
CreateServerStream(context context.Context, connection types.Connection,
callbacks types.ServerStreamConnectionEventListener) types.ServerStreamConnection
CreateBiDirectStream(context context.Context, connection types.ClientConnection,
clientCallbacks types.StreamConnectionEventListener,
serverCallbacks types.ServerStreamConnectionEventListener) types.ClientStreamConnection
ProtocolMatch(context context.Context, prot string, magic []byte) error
}
Click to show internal directories.
Click to hide internal directories.