Documentation
¶
Index ¶
- type CwtchServerListenChannel
- func (cc *CwtchServerListenChannel) Bidirectional() bool
- func (cc *CwtchServerListenChannel) Closed(err error)
- func (cc *CwtchServerListenChannel) OnlyClientCanOpen() bool
- func (cc *CwtchServerListenChannel) OpenInbound(channel *channels.Channel, raw *Protocol_Data_Control.OpenChannel) ([]byte, error)
- func (cc *CwtchServerListenChannel) OpenOutbound(channel *channels.Channel) ([]byte, error)
- func (cc *CwtchServerListenChannel) OpenOutboundResult(err error, crm *Protocol_Data_Control.ChannelResult)
- func (cc *CwtchServerListenChannel) Packet(data []byte)
- func (cc *CwtchServerListenChannel) RequiresAuthentication() string
- func (cc *CwtchServerListenChannel) SendGroupMessage(gm *protocol.GroupMessage)
- func (cc *CwtchServerListenChannel) Singleton() bool
- func (cc *CwtchServerListenChannel) Type() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CwtchServerListenChannel ¶
type CwtchServerListenChannel struct {
// contains filtered or unexported fields
}
CwtchServerListenChannel implements the ChannelHandler interface for a channel of type "im.cwtch.server.listen" - this implementation only handles server side logic.
func (*CwtchServerListenChannel) Bidirectional ¶
func (cc *CwtchServerListenChannel) Bidirectional() bool
Bidirectional - for Cwtch channels are not bidrectional
func (*CwtchServerListenChannel) Closed ¶
func (cc *CwtchServerListenChannel) Closed(err error)
Closed is called when the channel is closed for any reason.
func (*CwtchServerListenChannel) OnlyClientCanOpen ¶
func (cc *CwtchServerListenChannel) OnlyClientCanOpen() bool
OnlyClientCanOpen - for Cwtch channels any side can open
func (*CwtchServerListenChannel) OpenInbound ¶
func (cc *CwtchServerListenChannel) OpenInbound(channel *channels.Channel, raw *Protocol_Data_Control.OpenChannel) ([]byte, error)
OpenInbound is the first method called for an inbound channel request. If an error is returned, the channel is rejected. If a RawMessage is returned, it will be sent as the ChannelResult message.
func (*CwtchServerListenChannel) OpenOutbound ¶
func (cc *CwtchServerListenChannel) OpenOutbound(channel *channels.Channel) ([]byte, error)
OpenOutbound is the first method called for an outbound channel request. If an error is returned, the channel is not opened. If a RawMessage is returned, it will be sent as the OpenChannel message.
func (*CwtchServerListenChannel) OpenOutboundResult ¶
func (cc *CwtchServerListenChannel) OpenOutboundResult(err error, crm *Protocol_Data_Control.ChannelResult)
OpenOutboundResult is called when a response is received for an outbound OpenChannel request. If `err` is non-nil, the channel was rejected and Closed will be called immediately afterwards. `raw` contains the raw protocol message including any extension data.
func (*CwtchServerListenChannel) Packet ¶
func (cc *CwtchServerListenChannel) Packet(data []byte)
Packet is called for each raw packet received on this channel.
func (*CwtchServerListenChannel) RequiresAuthentication ¶
func (cc *CwtchServerListenChannel) RequiresAuthentication() string
RequiresAuthentication - Cwtch channels require hidden service auth
func (*CwtchServerListenChannel) SendGroupMessage ¶
func (cc *CwtchServerListenChannel) SendGroupMessage(gm *protocol.GroupMessage)
SendGroupMessage sends a single group message to the peer
func (*CwtchServerListenChannel) Singleton ¶
func (cc *CwtchServerListenChannel) Singleton() bool
Singleton - for Cwtch channels there can only be one instance per direction
func (*CwtchServerListenChannel) Type ¶
func (cc *CwtchServerListenChannel) Type() string
Type returns the type string for this channel, e.g. "im.ricochet.Cwtch".