{"id":17559850,"url":"https://github.com/alexruzin/govfs","last_synced_at":"2025-04-24T05:41:19.017Z","repository":{"id":57503401,"uuid":"106014805","full_name":"AlexRuzin/govfs","owner":"AlexRuzin","description":"A Virtual Filesystem Library written in the Go programming language. ","archived":false,"fork":false,"pushed_at":"2018-04-24T22:45:12.000Z","size":104,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T07:23:19.047Z","etag":null,"topics":["cross-platform","filesystem","filesystem-library","go","golang","library","virtual"],"latest_commit_sha":null,"homepage":null,"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/AlexRuzin.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":"2017-10-06T14:34:59.000Z","updated_at":"2023-04-30T23:06:23.000Z","dependencies_parsed_at":"2022-09-13T08:31:02.221Z","dependency_job_id":null,"html_url":"https://github.com/AlexRuzin/govfs","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/AlexRuzin%2Fgovfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexRuzin%2Fgovfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexRuzin%2Fgovfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexRuzin%2Fgovfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexRuzin","download_url":"https://codeload.github.com/AlexRuzin/govfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250573289,"owners_count":21452337,"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":["cross-platform","filesystem","filesystem-library","go","golang","library","virtual"],"created_at":"2024-10-21T11:07:58.092Z","updated_at":"2025-04-24T05:41:18.981Z","avatar_url":"https://github.com/AlexRuzin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# govfs\nA Virtual Filesystem Library written in the Go programming language. Please note that this project is still under heavy development.\n\n## Synopsis\nThe govfs Virtual Filesystem is a ext3/4 Unix-based heirarchy type filesystem which begins from the root folder \"/\". Each file is represented by a meta header which may be referenced in O(1) time, i.e. this filesystem does not use a linked list to create a filesystem \"tree\", but rather a hash-table which allows for the quick reference of files.\n\nIn addition, govfs makes use of golang's gothreads by implementing very quick read/writes. I.E. there is a thread dispatched for each write operation (assuming it is a different file). So writing 1000 files concurrently is possible without breaking the filesystem.\n\nSince this is an in-memory file system, upon unmount the filesystem data is stored in a serialized stream. This, too, is concurrent. So for each file that contains data, a thread will be spawned that will perform compression on the file and serialization of the meta data.\n\n## Features\n1. **2^128** files\n2. No file size limit\n3. Concurrent reads/writes\n4. **O(1)** reference time for finding a file header\n5. Can print out file lists\n6. File metadata serialization upon unmount (i.e. writing the entire filesystem to a physical file)\n7. The filesystem file is OS independent\n8. Creating one file will automatically create each subdirectory\n9. Ideal for projects with heavy filesystem utilization\n10. Compression and encryption of the raw filesystem file (unmounted file) is available\n\n## API\n\n### Main Filesystem Header\nThe FSHeader structure contains all data related to the virtual filesystem\n```go\ntype FSHeader struct {\n    filename    string                             /* The raw file on disk */\n    key         [16]byte                           /* RC4 key used to encrypt/decrypt the raw file */\n    meta        map[string]*gofs_file              /* Hash table containing each file header */\n    t_size      uint                               /* Total size of all files */\n    [... Other structures/members omitted ...]\n}\n```\n\n### Create/Load Database\n```go\nfunc CreateDatabase(name string, flags int) *FSHeader\n```\n\n### Create New File\n```go\nfunc (f *FSHeader) Create(name string) (*gofs_file, error)\n```\n\n### Create I/O Reader\n```go\nfunc (f *FSHeader) NewReader(name string) (*Reader, error)\n```\n\n### Standard Read()\n```go\nfunc (f *Reader) Read(p []byte) (int, error) \n```\n\n### I/O Reader\n```go\nfunc (f *FSHeader) Read(name string) ([]byte, error)\n```\n\n### Delete File\n```go\nfunc (f *FSHeader) Delete(name string) error\n```\n\n### Write to a file\n```go\nfunc (f *FSHeader) Write(name string, d []byte) error\n```\n\n### Writer interface\n```go\ntype Writer struct {\n    Name string\n    File *gofs_file\n    Hdr *FSHeader\n}\n```\n\n### New Writer method\n```go\nfunc (f *FSHeader) NewWriter(name string) (*Writer, error)\n```\n\n### Write method\n```go\nfunc (f *Writer) Write(p []byte) (int, error)\n```\n\n### Disclaimer\nPlease see the `LICENSE` file for the detailed MIT license. \nAll work written by **Stan Ruzin** _stan_ [dot] _ruzin_ [at] _gmail_ [dot] _com_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexruzin%2Fgovfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexruzin%2Fgovfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexruzin%2Fgovfs/lists"}