Documentation ¶
Overview ¶
Package udp provides common functionality used in udpc and udps packages
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // ID ID() string // Stringify String() string // Closes the client Close(code int, reason string) // Sends a Message to the Server Send(msg *network.Message) (rmsg *network.Message, err error) // Opens a Stream to the Server OpenStream(data map[string]string) (stream *Stream, err error) // Closes a Stream CloseStream(id string) }
Client Interface stipulates functions which should be present in a client
type Stream ¶
type Stream struct { // Stream ID Id string // Stream Metadata Data map[string]string // Exit Channel Exit chan bool // Closed Status Closed bool // contains filtered or unexported fields }
Stream holds the configuration related to a single Stream
func HandleStream ¶
func HandleStream(logger *logrus.Logger, stream quic.Stream, unmarshalers []network.ChannelUnmarshaler) (cstream *Stream, err error)
HandleStream wraps the quic.Stream and provides useful functionality to manage it
func NewStreamFromData ¶
func NewStreamFromData(data *model.StreamConnectionData, channel *network.Channel) *Stream
Wraps a channel into a Stream and does not initialize it This function should be used when the stream is already initialized
Click to show internal directories.
Click to hide internal directories.