{"id":20284468,"url":"https://github.com/artyom/assetfs","last_synced_at":"2025-10-25T15:09:53.809Z","repository":{"id":66758950,"uuid":"47348971","full_name":"artyom/assetfs","owner":"artyom","description":"Command to generate http.FileSystem implementation compiling assets into Go binary","archived":false,"fork":false,"pushed_at":"2017-04-04T06:22:16.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-01-14T07:53:54.938Z","etag":null,"topics":["filesystem","go","static-website"],"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/artyom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2015-12-03T17:40:12.000Z","updated_at":"2017-04-04T06:22:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"261f4478-eef0-4870-8421-592ff7d603ff","html_url":"https://github.com/artyom/assetfs","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/artyom%2Fassetfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artyom%2Fassetfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artyom%2Fassetfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artyom%2Fassetfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artyom","download_url":"https://codeload.github.com/artyom/assetfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241780465,"owners_count":20019058,"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":["filesystem","go","static-website"],"created_at":"2024-11-14T14:19:50.509Z","updated_at":"2025-10-25T15:09:53.758Z","avatar_url":"https://github.com/artyom.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Command `assetfs` generates http.FileSystem implementation compiling assets\ninside go binary as byte slices. Generated file exposes function AssetDir()\nwhich usage is similar to http.Dir() usage.\n\nassetfs can generate 2 files: one for production usage, where assets should be\ncompiled inside binary, and one for development usage, where AssetDir() is\naliases to http.Dir() and files are served from disk. As both files exposes\nfunction with the same name, they're differentiated with build tags.\n\n\tUsage: assetfs [flags] assetsDir ...\n\t  -dev string\n\t\tpath to write development stub\n\t  -devtag string\n\t\tbuild tag to assign to development stub (default \"dev\")\n\t  -name string\n\t\tpackage name\n\t  -out string\n\t\tpath to write generated content\n\t  -tag string\n\t\tbuild tag to use for main generated file\n\nThis program is mainly intended to be used with `go generate` as follows:\n\nConsider your repository has `static` subdirectory which is normally exposed as\n`http.Dir(\"static\")`. Create file `static.go` with the following content:\n\n\tpackage mypackage\n\t//go:generate assetfs static\n\nOnce you run `go generate`, it will produce two extra files:\n`static_assetfs.go` and `static_assetfs-dev.go`. Both expose `AssetDir()`\nfunction, the latter has this function aliased to `http.Dir()` and has `dev`\nbuild tag set, so it can be used during development when you expect to see\nchanges in static files as you refresh page. Next thing to do would be to\nreplace usage of `http.Dir(\"static\")` with `AssetDir(\"static\")` in your code.\n\n`assetfs` main intention is to include **small** static assets inside compiled\nGo binary, so that resulting program has less file dependencies. As all\nincluded files are stored as byte slices, they affect both binary size and\nruntime memory consumption, so you should avoid including large files.\nCurrently the only artificial limit built in is for a single file size (10\nMiB).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartyom%2Fassetfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartyom%2Fassetfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartyom%2Fassetfs/lists"}