Miki Tebeka  committed 6d65218

ignore and README

  • Participants
  • Parent commits 48bbbf9
  • Branches default

Comments (0)

Files changed (2)

+syntax: glob
+`nrsc` - Resource Compiler for Go
+`nrsc` compiles a directory of resource into a Go source file so you can still
+deploy a single executable as a web server with all the CSS, image files, JS ...
+    nrsc path_to_resource_dir
+This will emit to standard output a Go source file code (in package `main`)
+The main object is `nrsc`, it has the following interface
+`nrsc.Handle(prefix string)`
+    This will register with the `net/http` module to handle all paths starting with prefix. 
+    When a request is handled, `prefix` is stripped and then a resource is
+    located and served.
+    Resource that are not found will cause an HTTP 404 response.
+`nrsc.Get(path string) Resource`
+    Will return a resource interface (or `nil` if not found) (see resource interface below).
+    This allows you more control on how to serve.
+Resource Interface
+`func Open() io.Reader`
+    Returns a reader to resource data
+`func Length() int`
+    Returns resource size (to be used with `Content-Length` HTTP header).
+`func Type() string`
+    Returns mime type (to be used with `Content-Type` HTTP header).
+`func Time() time.Time`
+    Returns modification time (to be used with `Last-Modified` HTTP header).
+Current status of the code is "playing". Nothing really written. There's an
+example implementation in the `resources` directory and a web server in `hw.go`.