proxy.golang.org : github.com/ardanlabs/udp
Package udp provides the boilerpale code for working with UDP based data. The package allows you to establish a UDP listener that can accept data on a specified IP address and port. It also provides a function to send data back to the client. There are three interfaces that need to be implemented to use the package. These interfaces provide the API for processing data. ConnHandler The ConnHandler interface is implemented by the user to bind the listener to a reader and writer for processing. ReqHandler The ReqHandler interface is implemented by the user to implement the processing of request messages from the client. Read is provided the user-defined reader and must return the data read off the wire and the length. Returning io.EOF or a non temporary error will show down the listener. RespHandler The RespHandler interface is implemented by the user to implement the processing of the response messages to the client. Write is provided the user-defined writer and the data to write. After implementing the interfaces, the following code is all that is needed to start processing messages.
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/ardanlabs/udp
License: Apache-2.0
Latest release: over 5 years ago
First release: over 5 years ago
Namespace: github.com/ardanlabs
Stars: 8 on GitHub
Forks: 3 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 1 day ago