{"id":16024815,"url":"https://github.com/joseluisq/gonetc","last_synced_at":"2025-08-04T10:38:30.834Z","repository":{"id":57557371,"uuid":"320414848","full_name":"joseluisq/gonetc","owner":"joseluisq","description":"A simple Go net wrapper client interface.","archived":false,"fork":false,"pushed_at":"2023-03-28T21:28:42.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-28T09:40:47.890Z","etag":null,"topics":["go-net","go-package","golang","ipc-socket","net-client","socket","tcp"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joseluisq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-12-10T23:27:12.000Z","updated_at":"2023-03-28T21:09:52.000Z","dependencies_parsed_at":"2023-10-12T07:30:38.032Z","dependency_job_id":null,"html_url":"https://github.com/joseluisq/gonetc","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"c8f874bcb109c5d634668a4336e69c494e67c720"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/joseluisq/gonetc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joseluisq%2Fgonetc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joseluisq%2Fgonetc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joseluisq%2Fgonetc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joseluisq%2Fgonetc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joseluisq","download_url":"https://codeload.github.com/joseluisq/gonetc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joseluisq%2Fgonetc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268290776,"owners_count":24226649,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-net","go-package","golang","ipc-socket","net-client","socket","tcp"],"created_at":"2024-10-08T19:40:19.729Z","updated_at":"2025-08-04T10:38:30.797Z","avatar_url":"https://github.com/joseluisq.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gonetc ![devel](https://github.com/joseluisq/gonetc/workflows/devel/badge.svg) [![codecov](https://codecov.io/gh/joseluisq/gonetc/branch/master/graph/badge.svg)](https://codecov.io/gh/joseluisq/gonetc) [![Go Report Card](https://goreportcard.com/badge/github.com/joseluisq/gonetc)](https://goreportcard.com/report/github.com/joseluisq/gonetc) [![PkgGoDev](https://pkg.go.dev/badge/github.com/joseluisq/gonetc)](https://pkg.go.dev/github.com/joseluisq/gonetc)\n\n\u003e A simple [Go Network](https://golang.org/pkg/net/) wrapper client interface.\n\n## Usage\n\n```go\npackage main\n\nimport (\n    \"log\"\n    \"strings\"\n\n    \"github.com/joseluisq/gonetc\"\n)\n\nfunc main() {\n    // Code example using IPC Unix Sockets\n\n    // 1. Create a simple listening Unix socket with echo functionality\n    // using the `socat` tool -\u003e http://www.dest-unreach.org/socat/\n    // Then execute the following commands on your terminal:\n    //  rm -f /tmp/mysocket \u0026\u0026 socat UNIX-LISTEN:/tmp/mysocket,fork exec:'/bin/cat'\n\n    // 2. Now just run this client code example in order to exchange data with current socket.\n    //  go run examples/main.go\n\n    // 2.1 Connect to the listening socket\n    sock := gonetc.New(\"unix\", \"/tmp/mysocket\")\n    err := sock.Connect()\n    if err != nil {\n        log.Fatalln(\"unable to communicate with socket:\", err)\n    }\n\n    // 2.2 Send some sequential data to current socket (example only)\n    pangram := strings.Split(\"The quick brown fox jumps over the lazy dog\", \" \")\n    for _, word := range pangram {\n        log.Println(\"client data sent:\", word)\n        _, err := sock.Write([]byte(word), func(resp []byte, err error, done func()) {\n            if err != nil {\n                log.Fatalln(\"unable to write data to socket\", err)\n            }\n            log.Println(\"client data received:\", string(resp))\n            // Finish the current write handling response if we are done\n            done()\n        })\n        if err != nil {\n            log.Fatalln(\"unable to write to socket:\", err)\n        }\n    }\n\n    sock.Close()\n\n    // 3. Finally after running the client you'll see a similar output like:\n    //\n    // 2020/12/11 00:32:27 client data sent: The\n    // 2020/12/11 00:32:27 client data received: The\n    // 2020/12/11 00:32:28 client data sent: quick\n    // 2020/12/11 00:32:28 client data received: quick\n    // 2020/12/11 00:32:29 client data sent: brown\n    // 2020/12/11 00:32:29 client data received: brown\n    // 2020/12/11 00:32:30 client data sent: fox\n    // 2020/12/11 00:32:30 client data received: fox\n    // 2020/12/11 00:32:31 client data sent: jumps\n    // 2020/12/11 00:32:31 client data received: jumps\n    // 2020/12/11 00:32:32 client data sent: over\n    // 2020/12/11 00:32:32 client data received: over\n    // 2020/12/11 00:32:33 client data sent: the\n    // 2020/12/11 00:32:33 client data received: the\n    // 2020/12/11 00:32:34 client data sent: lazy\n    // 2020/12/11 00:32:34 client data received: lazy\n    // 2020/12/11 00:32:35 client data sent: dog\n    // 2020/12/11 00:32:35 client data received: dog\n}\n```\n\n## Contributions\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in current work by you, as defined in the Apache-2.0 license, shall be dual licensed as described below, without any additional terms or conditions.\n\nFeel free to send some [Pull request](https://github.com/joseluisq/gonetc/pulls) or [issue](https://github.com/joseluisq/gonetc/issues).\n\n## License\n\nThis work is primarily distributed under the terms of both the [MIT license](LICENSE-MIT) and the [Apache License (Version 2.0)](LICENSE-APACHE).\n\n© 2020-present [Jose Quintana](https://git.io/joseluisq)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoseluisq%2Fgonetc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoseluisq%2Fgonetc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoseluisq%2Fgonetc/lists"}