{"id":21043079,"url":"https://github.com/mrinalxdev/updframework","last_synced_at":"2026-03-02T14:40:51.585Z","repository":{"id":247773539,"uuid":"816160390","full_name":"mrinalxdev/updframework","owner":"mrinalxdev","description":"A golang framework to make easier to work with UDP protocol","archived":false,"fork":false,"pushed_at":"2024-08-29T12:57:48.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-12T15:11:25.959Z","etag":null,"topics":["go","udp-protocol"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrinalxdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-17T06:50:41.000Z","updated_at":"2024-08-29T13:02:00.000Z","dependencies_parsed_at":"2024-08-29T14:13:17.674Z","dependency_job_id":"fb7a36e1-1d9b-4a3d-88be-8a4cebe8ca28","html_url":"https://github.com/mrinalxdev/updframework","commit_stats":null,"previous_names":["mrinalxdev/streamkit","mrinalxdev/updframework"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mrinalxdev/updframework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrinalxdev%2Fupdframework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrinalxdev%2Fupdframework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrinalxdev%2Fupdframework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrinalxdev%2Fupdframework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrinalxdev","download_url":"https://codeload.github.com/mrinalxdev/updframework/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrinalxdev%2Fupdframework/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30006768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T14:08:50.421Z","status":"ssl_error","status_checked_at":"2026-03-02T14:08:50.037Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","udp-protocol"],"created_at":"2024-11-19T14:10:51.718Z","updated_at":"2026-03-02T14:40:51.562Z","avatar_url":"https://github.com/mrinalxdev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UdGo\n\nThis project implements an advanced UDP (User Datagram Protocol) framework in Go, featuring automated packet reassembly, customizable retry and timeout mechanisms, and packet prioritization with Quality of Service (QoS) support.\n\n## Table of Contents\n\n1. [Features](#features)\n2. [Installation](#installation)\n3. [Usage](#usage)\n4. [API Reference](#api-reference)\n5. [Configuration](#configuration)\n6. [Examples](#examples)\n7. [Contributing](#contributing)\n8. [License](#license)\n\n## Features\n\n1. **Automated Packet Reassembly**: Ensures data integrity and order in a connectionless protocol.\n2. **Customizable Retry and Timeout Mechanisms**: Improves reliability in high packet loss environments.\n3. **Packet Prioritization and QoS**: Allows critical data to be transmitted first.\n\n## Installation\n\nTo install the UDP framework, use the following command:\n\n```bash\ngo get github.com/mrinalxdev/udpframework\n```\n\n## Usage\n\nHere's a basic example of how to use the UDP framework:\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"net\"\n\n\t\"github.com/mrinalxdev/udpframework\"\n)\n\nfunc main() {\n\tretryConfig := udpframework.RetryConfig{\n\t\tMaxRetries:  3,\n\t\tBaseTimeout: time.Second,\n\t\tBackoffRate: 1.5,\n\t}\n\n\tqosConfig := udpframework.QoSConfig{\n\t\tPriorityLevels: 3,\n\t\tPriorityQueues: make([][]udpframework.Packet, 3),\n\t}\n\n\tframework, err := udpframework.UdGo(\":8080\", retryConfig, qosConfig)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer framework.Close()\n\n\t// Send a packet\n\tpacket := udpframework.Packet{\n\t\tSequenceNumber: 1,\n\t\tPriority:       2,\n\t\tData:           []byte(\"Hello, UDP!\"),\n\t}\n\tdestAddr, _ := net.ResolveUDPAddr(\"udp\", \"localhost:9090\")\n\terr = framework.SendPacket(packet, destAddr)\n\tif err != nil {\n\t\tlog.Printf(\"Error sending packet: %v\", err)\n\t}\n\n\t// Receive packets\n\tfor {\n\t\tdata, addr, err := framework.ReceivePacket()\n\t\tif err != nil {\n\t\t\tlog.Printf(\"Error receiving packet: %v\", err)\n\t\t\tcontinue\n\t\t}\n\t\tlog.Printf(\"Received from %v: %s\", addr, string(data))\n\t}\n}\n```\n\n## API Reference\n\n### Types\n\n#### UDPFramework\n\n```go\ntype UDPFramework struct {\n\t// Unexported fields\n}\n```\n\nThe main struct for the UDP framework.\n\n#### Packet\n\n```go\ntype Packet struct {\n\tSequenceNumber uint32\n\tPriority       int\n\tData           []byte\n\tRetryCount     int\n}\n```\n\nRepresents a UDP packet with additional metadata.\n\n#### RetryConfig\n\n```go\ntype RetryConfig struct {\n\tMaxRetries  int\n\tBaseTimeout time.Duration\n\tBackoffRate float64\n}\n```\n\nHolds the configuration for retry and timeout mechanisms.\n\n#### QoSConfig\n\n```go\ntype QoSConfig struct {\n\tPriorityLevels int\n\tPriorityQueues [][]Packet\n}\n```\n\nHolds the configuration for Quality of Service.\n\n### Functions\n\n#### UdGo\n\n```go\nfunc UdGo(addr string, retryConfig RetryConfig, qosConfig QoSConfig) (*UDPFramework, error)\n```\n\nCreates a new instance of UDPFramework.\n\n#### SendPacket\n\n```go\nfunc (uf *UDPFramework) SendPacket(packet Packet, destAddr *net.UDPAddr) error\n```\n\nSends a packet with automatic retries and prioritization.\n\n#### ReceivePacket\n\n```go\nfunc (uf *UDPFramework) ReceivePacket() ([]byte, *net.UDPAddr, error)\n```\n\nReceives and reassembles packets.\n\n#### Close\n\n```go\nfunc (uf *UDPFramework) Close() error\n```\n\nCloses the UDP connection.\n\n## Configuration\n\n### Retry Configuration\n\n- `MaxRetries`: Maximum number of retry attempts.\n- `BaseTimeout`: Initial timeout duration.\n- `BackoffRate`: Rate at which the timeout increases after each retry.\n\n### QoS Configuration\n\n- `PriorityLevels`: Number of priority levels.\n- `PriorityQueues`: Slice of queues for each priority level.\n\n## Examples\n\n### Sending a High-Priority Packet\n\n```go\npacket := udpframework.Packet{\n\tSequenceNumber: 1,\n\tPriority:       2, // High priority\n\tData:           []byte(\"Important message\"),\n}\ndestAddr, _ := net.ResolveUDPAddr(\"udp\", \"localhost:9090\")\nerr := framework.SendPacket(packet, destAddr)\n```\n\n### Receiving and Reassembling Packets\n\n```go\nfor {\n\tdata, addr, err := framework.ReceivePacket()\n\tif err != nil {\n\t\tlog.Printf(\"Error receiving packet: %v\", err)\n\t\tcontinue\n\t}\n\tlog.Printf(\"Reassembled message from %v: %s\", addr, string(data))\n}\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrinalxdev%2Fupdframework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrinalxdev%2Fupdframework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrinalxdev%2Fupdframework/lists"}