Documentation
¶
Index ¶
- func NewEndWithConn(conn net.Conn, opts ...*EndOptions) (geminio.End, error)
- type EndOptions
- func (eo *EndOptions) SetAcceptStreamFunc(fn func(geminio.Stream))
- func (eo *EndOptions) SetClientID(clientID uint64)
- func (eo *EndOptions) SetClosedStreamFunc(fn func(geminio.Stream))
- func (eo *EndOptions) SetDelegate(delegate delegate.ServerDelegate)
- func (eo *EndOptions) SetLog(log log.Logger)
- func (eo *EndOptions) SetPacketFactory(packetFactory packet.PacketFactory)
- func (eo *EndOptions) SetRegisterLocalRPCs(methodRPCs ...*geminio.MethodRPC)
- func (eo *EndOptions) SetRemoteRPCCheck()
- func (eo *EndOptions) SetTimer(timer timer.Timer)
- func (eo *EndOptions) SetWaitRemoteRPCs(methods ...string)
- type Listener
- type ServerEnd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEndWithConn ¶
Types ¶
type EndOptions ¶
type EndOptions struct { Timer timer.Timer TimerOwner interface{} PacketFactory packet.PacketFactory Log log.Logger Delegate delegate.ServerDelegate ClientID *uint64 RemoteMethods []string RemoteMethodCheck bool LocalMethods []*geminio.MethodRPC // If set AcceptStreamFunc, the AcceptStream should never be called AcceptStreamFunc func(geminio.Stream) ClosedStreamFunc func(geminio.Stream) }
func MergeEndOptions ¶
func MergeEndOptions(opts ...*EndOptions) *EndOptions
func NewEndOptions ¶
func NewEndOptions() *EndOptions
func (*EndOptions) SetAcceptStreamFunc ¶ added in v1.1.1
func (eo *EndOptions) SetAcceptStreamFunc(fn func(geminio.Stream))
func (*EndOptions) SetClientID ¶
func (eo *EndOptions) SetClientID(clientID uint64)
func (*EndOptions) SetClosedStreamFunc ¶ added in v1.1.1
func (eo *EndOptions) SetClosedStreamFunc(fn func(geminio.Stream))
func (*EndOptions) SetDelegate ¶
func (eo *EndOptions) SetDelegate(delegate delegate.ServerDelegate)
func (*EndOptions) SetLog ¶
func (eo *EndOptions) SetLog(log log.Logger)
func (*EndOptions) SetPacketFactory ¶
func (eo *EndOptions) SetPacketFactory(packetFactory packet.PacketFactory)
func (*EndOptions) SetRegisterLocalRPCs ¶ added in v1.1.0
func (eo *EndOptions) SetRegisterLocalRPCs(methodRPCs ...*geminio.MethodRPC)
func (*EndOptions) SetRemoteRPCCheck ¶ added in v1.1.4
func (eo *EndOptions) SetRemoteRPCCheck()
func (*EndOptions) SetTimer ¶
func (eo *EndOptions) SetTimer(timer timer.Timer)
func (*EndOptions) SetWaitRemoteRPCs ¶
func (eo *EndOptions) SetWaitRemoteRPCs(methods ...string)
type Listener ¶
type Listener interface { // Accept waits for and returns the next end to the listener. AcceptEnd() (geminio.End, error) // Accept waits for and returns the next connection to the listener. // the returned Conn is actually a End Accept() (net.Conn, error) // Close closes the listener. // Any blocked Accept operations will be unblocked and return errors. Close() error // Addr returns the listener's network address. Addr() net.Addr }
Click to show internal directories.
Click to hide internal directories.