Documentation
¶
Index ¶
- type CwtchServerSendChannel
- func (cc *CwtchServerSendChannel) Bidirectional() bool
- func (cc *CwtchServerSendChannel) Closed(err error)
- func (cc *CwtchServerSendChannel) OnlyClientCanOpen() bool
- func (cc *CwtchServerSendChannel) OpenInbound(channel *channels.Channel, raw *Protocol_Data_Control.OpenChannel) ([]byte, error)
- func (cc *CwtchServerSendChannel) OpenOutbound(channel *channels.Channel) ([]byte, error)
- func (cc *CwtchServerSendChannel) OpenOutboundResult(err error, crm *Protocol_Data_Control.ChannelResult)
- func (cc *CwtchServerSendChannel) Packet(data []byte)
- func (cc *CwtchServerSendChannel) RequiresAuthentication() string
- func (cc *CwtchServerSendChannel) Singleton() bool
- func (cc *CwtchServerSendChannel) Type() string
- type CwtchServerSendChannelHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CwtchServerSendChannel ¶
type CwtchServerSendChannel struct { // Methods of Handler are called for Cwtch events on this channel Handler CwtchServerSendChannelHandler // contains filtered or unexported fields }
CwtchServerSendChannel implements the ChannelHandler interface for a channel of type "im.cwtch.server.send - this implementation only handles server-side logic.
func (*CwtchServerSendChannel) Bidirectional ¶
func (cc *CwtchServerSendChannel) Bidirectional() bool
Bidirectional - for Cwtch channels are not bidrectional
func (*CwtchServerSendChannel) Closed ¶
func (cc *CwtchServerSendChannel) Closed(err error)
Closed is called when the channel is closed for any reason.
func (*CwtchServerSendChannel) OnlyClientCanOpen ¶
func (cc *CwtchServerSendChannel) OnlyClientCanOpen() bool
OnlyClientCanOpen - for Cwtch channels any side can open
func (*CwtchServerSendChannel) OpenInbound ¶
func (cc *CwtchServerSendChannel) 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 (*CwtchServerSendChannel) OpenOutbound ¶
func (cc *CwtchServerSendChannel) 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 (*CwtchServerSendChannel) OpenOutboundResult ¶
func (cc *CwtchServerSendChannel) 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 (*CwtchServerSendChannel) Packet ¶
func (cc *CwtchServerSendChannel) Packet(data []byte)
Packet is called for each raw packet received on this channel.
func (*CwtchServerSendChannel) RequiresAuthentication ¶
func (cc *CwtchServerSendChannel) RequiresAuthentication() string
RequiresAuthentication - Cwtch channels require hidden service auth
func (*CwtchServerSendChannel) Singleton ¶
func (cc *CwtchServerSendChannel) Singleton() bool
Singleton - for Cwtch channels there can only be one instance per direction
func (*CwtchServerSendChannel) Type ¶
func (cc *CwtchServerSendChannel) Type() string
Type returns the type string for this channel, e.g. "im.ricochet.Cwtch".
type CwtchServerSendChannelHandler ¶
type CwtchServerSendChannelHandler interface {
HandleGroupMessage(*protocol.GroupMessage)
}
CwtchServerSendChannelHandler defines the interface needed to interact with this channel