fetch

package
v0.3.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CwtchServerFetchChannel

type CwtchServerFetchChannel struct {
	Handler CwtchServerFetchHandler
	// contains filtered or unexported fields
}

CwtchServerFetchChannel implements the ChannelHandler interface for a channel of type "im.cwtch.server.fetch" - this implementation only handles server side logic.

func (*CwtchServerFetchChannel) Bidirectional

func (cc *CwtchServerFetchChannel) Bidirectional() bool

Bidirectional - for Cwtch channels are not bidrectional

func (*CwtchServerFetchChannel) Closed

func (cc *CwtchServerFetchChannel) Closed(err error)

Closed is called when the channel is closed for any reason.

func (*CwtchServerFetchChannel) OnlyClientCanOpen

func (cc *CwtchServerFetchChannel) OnlyClientCanOpen() bool

OnlyClientCanOpen - for Cwtch channels any side can open

func (*CwtchServerFetchChannel) OpenInbound

func (cc *CwtchServerFetchChannel) 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 (*CwtchServerFetchChannel) OpenOutbound

func (cc *CwtchServerFetchChannel) 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 (*CwtchServerFetchChannel) OpenOutboundResult

func (cc *CwtchServerFetchChannel) 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 (*CwtchServerFetchChannel) Packet

func (cc *CwtchServerFetchChannel) Packet(data []byte)

Packet is called for each raw packet received on this channel.

func (*CwtchServerFetchChannel) RequiresAuthentication

func (cc *CwtchServerFetchChannel) RequiresAuthentication() string

RequiresAuthentication - Cwtch channels require hidden service auth

func (*CwtchServerFetchChannel) SendGroupMessages

func (cc *CwtchServerFetchChannel) SendGroupMessages(gms []*protocol.GroupMessage)

SendGroupMessages sends a series of group messages to the client.

func (*CwtchServerFetchChannel) Singleton

func (cc *CwtchServerFetchChannel) Singleton() bool

Singleton - for Cwtch channels there can only be one instance per direction

func (*CwtchServerFetchChannel) Type

func (cc *CwtchServerFetchChannel) Type() string

Type returns the type string for this channel, e.g. "im.ricochet.Cwtch".

type CwtchServerFetchHandler

type CwtchServerFetchHandler interface {
	HandleFetchRequest() []*protocol.GroupMessage
}

CwtchServerFetchHandler defines the interface for interacting with this Channel

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL