{"id":21059087,"url":"https://github.com/ganeshrvel/one-archiver","last_synced_at":"2026-05-20T15:33:59.337Z","repository":{"id":110981867,"uuid":"294122665","full_name":"ganeshrvel/one-archiver","owner":"ganeshrvel","description":"A pure Go implementation of an all-in-one archiver package, supporting formats like zip, tar (with Brotli, bz2, gzip, lz4, snappy, xz, and zstd compressions), and read-only rar. Features include encryption handling, directory listing, file extraction, progress reporting, and password verification.","archived":false,"fork":false,"pushed_at":"2023-10-29T17:56:06.000Z","size":1597,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-20T19:51:15.570Z","etag":null,"topics":["go","golang","gzip","rar","tar","unrar","zip"],"latest_commit_sha":null,"homepage":"https://github.com/ganeshrvel/one-archiver","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/ganeshrvel.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":"2020-09-09T13:33:08.000Z","updated_at":"2024-09-09T14:22:28.000Z","dependencies_parsed_at":"2025-01-20T20:02:02.694Z","dependency_job_id":null,"html_url":"https://github.com/ganeshrvel/one-archiver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganeshrvel%2Fone-archiver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganeshrvel%2Fone-archiver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganeshrvel%2Fone-archiver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganeshrvel%2Fone-archiver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ganeshrvel","download_url":"https://codeload.github.com/ganeshrvel/one-archiver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243505953,"owners_count":20301617,"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","gzip","rar","tar","unrar","zip"],"created_at":"2024-11-19T17:09:53.858Z","updated_at":"2025-12-29T15:05:52.016Z","avatar_url":"https://github.com/ganeshrvel.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# One Archiver\nAll-in-one archiver package for Go.\n\n### Supported archive formats\n- zip\n- tar\n- tar.br (brotli)\n- tar.bz2 (bz2)\n- tar.gz (gzip)\n- tar.lz4\n- tar.sz (snappy)\n- tar.xz\n- tar.zst (zstd)\n- rar (read-only)\n\n### Format-dependent features\n- Create/read/extract an encrypted zip file\n- Read/extract an encrypted rar file\n- List a specific directory in an archive\n- Sort and list files by size, time, name, path\n- Extract specific files from an archive\n- Gitignore patterns for easy skipping files/directories\n- Emits progress while archiving and unarchiving\n- Check whether a zip or rar file is encrypted\n- Check whether the archive password is correct\n- Gzip is multithreaded\n- Make all necessary directories\n- Open password-protected RAR archives\n\n\n### Using the library\n```shell script\ngo get github.com/ganeshrvel/one-archiver\n```\n\nInstall Go mholt package (https://github.com/mholt/archiver/issues/195)\n```shell script\ncd $GOPATH\ngo get github.com/pierrec/lz4 \u0026\u0026 cd $GOPATH/src/github.com/pierrec/lz4 \u0026\u0026 git fetch \u0026\u0026 git checkout v3.0.1\n```\n\n### APIs\n**List an archive**\n\n```go\nfilename := \"test.zip\"\n\nif exist := onearchiver.FileExists(filename); !exist {\n    fmt.Printf(\"file does not exist: %s\\n\", filename)\n\n    return\n}\n\nam := \u0026onearchiver.ArchiveMeta{\n    Filename:         filename,\n    Password:         \"\",\n    GitIgnorePattern: []string{},\n}\n\nar := \u0026onearchiver.ArchiveRead{\n    ListDirectoryPath: \"test-directory/\",\n    Recursive:         true,\n    OrderBy:           onearchiver.OrderByName,\n    OrderDir:          onearchiver.OrderDirAsc,\n}\n\nresult, err := onearchiver.GetArchiveFileList(am, ar)\n\nif err != nil {\n    fmt.Printf(\"Error occured: %+v\\n\", err)\n\n    return\n}\n\nfmt.Printf(\"Result: %+v\\n\", result)\n```\n\n\n**Is encrypted**\n\n```go\nfilename := \"test.enc.zip\"\n//filename := \"test.encrypted.rar\"\n\nif exist := onearchiver.FileExists(filename); !exist {\n    fmt.Printf(\"file does not exist %s\\n\", filename)\n\n    return\n}\n\nam := \u0026onearchiver.ArchiveMeta{\n    Filename: filename,\n    Password: \"1234567\",\n}\n\nresult, err := onearchiver.IsArchiveEncrypted(am)\n\nif err != nil {\n    fmt.Printf(\"Error occured: %+v\\n\", err)\n\n    return\n}\n\nfmt.Printf(\"Result; IsEncrypted: %v, IsValidPassword: %v\\n\", result.IsEncrypted, result.IsValidPassword)\n```\n\n\n\n**Pack**\n\n```go\nimport (\n\t\"fmt\"\n\t\"github.com/yeka/zip\"\n\t\"time\"\n)\n\nfilename := \"/path/pack.zip\"\npath1 := \"directory1\"\npath2 := \"directory2\"\n\nam := \u0026onearchiver.ArchiveMeta{\n    Filename:         filename,\n    GitIgnorePattern: []string{},\n    Password:         \"\",\n    EncryptionMethod: zip.StandardEncryption,\n}\n\nap := \u0026onearchiver.ArchivePack{\n    FileList: []string{path1, path2},\n}\n\nph := \u0026onearchiver.ProgressHandler{\n    OnReceived: func(pInfo *onearchiver.ProgressInfo) {\n        fmt.Printf(\"received: %v\\n\", pInfo)\n    },\n    OnError: func(err error, pInfo *onearchiver.ProgressInfo) {\n        fmt.Printf(\"error: %e\\n\", err)\n    },\n    OnCompleted: func(pInfo *onearchiver.ProgressInfo) {\n        elapsed := time.Since(pInfo.StartTime)\n\n        fmt.Println(\"observable is closed\")\n        fmt.Printf(\"Time taken to create the archive: %s\", elapsed)\n    },\n}\n\nerr := onearchiver.StartPacking(am, ap, ph)\nif err != nil {\n    fmt.Printf(\"Error occured: %+v\\n\", err)\n\n    return\n}\n\nfmt.Printf(\"Result: %+v\\n\", \"Success\")\n```\n\n\n**Unpack**\n\n```go\nimport (\n\t\"fmt\"\n\t\"github.com/yeka/zip\"\n\t\"time\"\n)\n\nfilename := \"/path/pack.zip\"\ndestination := \"arc_test_pack/\"\n\nam := \u0026onearchiver.ArchiveMeta{\n    Filename:         filename,\n    Password:         \"\",\n    GitIgnorePattern: []string{},\n}\n\nau := \u0026onearchiver.ArchiveUnpack{\n    FileList:    []string{},\n    Destination: tempDir,\n}\n\nph := \u0026onearchiver.ProgressHandler{\n    OnReceived: func(pInfo *onearchiver.ProgressInfo) {\n        fmt.Printf(\"received: %v\\n\", pInfo)\n    },\n    OnError: func(err error, pInfo *onearchiver.ProgressInfo) {\n        fmt.Printf(\"error: %e\\n\", err)\n    },\n    OnCompleted: func(pInfo *onearchiver.ProgressInfo) {\n        elapsed := time.Since(pInfo.StartTime)\n\n        fmt.Println(\"observable is closed\")\n        fmt.Printf(\"Time taken to unpack the archive: %s\", elapsed)\n    },\n}\n\nerr := onearchiver.StartUnpacking(am, au, ph)\nif err != nil {\n    fmt.Printf(\"Error occured: %+v\\n\", err)\n\n    return\n}\n\nfmt.Printf(\"Result: %+v\\n\", \"Success\")\n\n```\n\n\n### Credits\n- mholt/archiver (https://github.com/mholt/archiver)\n- yeka/zip (https://github.com/yeka/zip)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fganeshrvel%2Fone-archiver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fganeshrvel%2Fone-archiver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fganeshrvel%2Fone-archiver/lists"}