{"id":26826710,"url":"https://github.com/hslam/splice","last_synced_at":"2025-09-07T08:36:52.502Z","repository":{"id":57557290,"uuid":"320121050","full_name":"hslam/splice","owner":"hslam","description":"Package splice wraps the splice system call.","archived":false,"fork":false,"pushed_at":"2021-03-01T07:01:07.000Z","size":37,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T11:32:44.068Z","etag":null,"topics":["go","golang","linux","pipe","socket","splice","zero-copy","zerocopy"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hslam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-10T01:05:08.000Z","updated_at":"2025-02-21T07:34:33.000Z","dependencies_parsed_at":"2022-09-07T17:51:53.194Z","dependency_job_id":null,"html_url":"https://github.com/hslam/splice","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hslam%2Fsplice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hslam%2Fsplice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hslam%2Fsplice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hslam%2Fsplice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hslam","download_url":"https://codeload.github.com/hslam/splice/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251352070,"owners_count":21575856,"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","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","golang","linux","pipe","socket","splice","zero-copy","zerocopy"],"created_at":"2025-03-30T11:30:43.579Z","updated_at":"2025-04-28T17:01:15.472Z","avatar_url":"https://github.com/hslam.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# splice\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/hslam/splice)](https://pkg.go.dev/github.com/hslam/splice)\n[![Build Status](https://github.com/hslam/splice/workflows/build/badge.svg)](https://github.com/hslam/splice/actions)\n[![codecov](https://codecov.io/gh/hslam/splice/branch/master/graph/badge.svg)](https://codecov.io/gh/hslam/splice)\n[![Go Report Card](https://goreportcard.com/badge/github.com/hslam/splice)](https://goreportcard.com/report/github.com/hslam/splice)\n[![LICENSE](https://img.shields.io/github/license/hslam/splice.svg?style=flat-square)](https://github.com/hslam/splice/blob/master/LICENSE)\n\nPackage splice wraps the splice system call.\n\n## Get started\n\n### Install\n```\ngo get github.com/hslam/splice\n```\n### Import\n```\nimport \"github.com/hslam/splice\"\n```\n### Usage\n#### Example\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/hslam/splice\"\n\t\"io\"\n\t\"net\"\n\t\"time\"\n)\n\nfunc main() {\n\tcontents := \"Hello world\"\n\tlis, err := net.Listen(\"tcp\", \":9999\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer lis.Close()\n\tdone := make(chan bool)\n\tgo func() {\n\t\tconn, _ := lis.Accept()\n\t\tdefer conn.Close()\n\t\ttime.Sleep(time.Millisecond * 100)\n\t\tif _, err := splice.Splice(conn, conn, 1024); err != nil \u0026\u0026 err != io.EOF {\n\t\t\tpanic(err)\n\t\t}\n\t\tclose(done)\n\t}()\n\tconn, _ := net.Dial(\"tcp\", \"127.0.0.1:9999\")\n\tconn.Write([]byte(contents))\n\tbuf := make([]byte, 64)\n\tn, _ := conn.Read(buf)\n\tfmt.Println(string(buf[:n]))\n\tconn.Close()\n\t\u003c-done\n}\n```\n\n### Output\n```\nHello world\n```\n\n### License\nThis package is licensed under a MIT license (Copyright (c) 2020 Meng Huang)\n\n\n### Author\nsplice was written by Meng Huang.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhslam%2Fsplice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhslam%2Fsplice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhslam%2Fsplice/lists"}