An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 8.2% on proxy.golang.org

proxy.golang.org : github.com/gwatts/embedfiles

Command embedfiles converts one or more files into Go source code so that they may be compiled directly into a Go program. It is intended to be run via the go generate tool and creates an instance variable that provides file-like access to the embedded assets using a bytes.Reader. Additionally each file instance complies with the http.File interface. By default the generated package does not provide a type compatible with the http.FileServer interface to avoid importing net/http - Supplying the -include-http flag will enable support for that interface. For example to embed the html and css files in an assets directory into a new file called assets.go as part of a package called webserver: Code within the assets package could then open index.html for read: or could use an instance as a file server (assuming the -include-http flag was set): As each call to embedfiles generates a completely self-contained .go file, multiple independent .go files can be generated and compiled into a single package by using different -varname options, allowing for discrete groups of files to be assigned to different variable names.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/gwatts/embedfiles
License: MIT
Latest release: about 9 years ago
First release: about 9 years ago
Namespace: github.com/gwatts
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 13 days ago

    Loading...
    Readme
    Loading...