Documentation ¶
Overview ¶
Package udp provides common functionality used in udpc and udps packages
Index ¶
- Variables
- type Client
- type Stream
- func HandleStream(logger *logrus.Logger, stream quic.Stream, ...) (cstream *Stream, err error)
- func NewStream(metadata map[string]string, data map[string]string, channel *network.Channel) (s *Stream, err error)
- func NewStreamFromData(data *model.StreamConnectionData, channel *network.Channel) *Stream
- type StreamHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrorNotConnected = errors.New("not connected")
)
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(metadata map[string]string, 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 Data Metadata map[string]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 NewStream ¶
func NewStream(metadata map[string]string, data map[string]string, channel *network.Channel) (s *Stream, err error)
Wraps a channel into a Stream and initializes 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.