Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrReqTimedOut tells if the request is timed out ErrReqTimedOut = errors.New("Request timed out") )
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { // The request id ID string // From tells from who the message was // net.Addr.String() From string // MessageSize is the size of the message in amound of bytes // This can be used for tracking the recive process MessageSize uint64 // ReciveSize is the size of what we currently have recived (this does not count the upcommingParts) // If this is equal or more than MessageSize the message is completed // // This library doesn't check for data integrity thus the // ReciveSize can't be trusted to go never above the MessageSize ReciveSize uint64 // Stream is the channel whereover the library will send all message data // If there is no data is left (thus the message is completed) this channel will be closed, // This can be checked using: // data, ok := <- c.Stream // if !ok { // fmt.Println("No data left!, Message completed") // } Stream chan []byte // contains filtered or unexported fields }
Context contains all information
type Server ¶
type Server struct { ServAddr string Reciver func(*Context) BufferSize uint64 // contains filtered or unexported fields }
Server is the global type for dealing with the server
func Start ¶
func Start(options StartOptions) (*Server, error)
Start creates a server instace When provided no address address it will take a ramdom poort on 0.0.0.0 If there are more than 1 addresess defined the program will return an error
type StartOptions ¶
type StartOptions struct { // Address is a *ustom address use // If empty the program will select one for you Address string // BufferSize is the buffer size used for the udp pacakge // The later they are the less cpu intensive they are butt they will be less reliable // Default (8192) is used when BufferSize <= 0 BufferSize uint64 }
StartOptions are the options for the start function
Click to show internal directories.
Click to hide internal directories.