Documentation
¶
Overview ¶
Package cloud provides utilities for writing simple cloud-based web servers.
Most of the heavy lifting is done by packages in subdirectories. Package cloud itself mainly implements connections to the standard library and other interfaces.
This entire repo is but the draft of a draft. It exists to support the swtch.com web server. It may mature into something more general, or it may not.
Index ¶
- func Dir(cache *diskcache.Cache, dir string) http.FileSystem
- func LoadX509KeyPair(cache *diskcache.Cache, certFile, keyFile string) (tls.Certificate, error)
- func ServeHTTP(addr string, handler http.Handler) error
- func ServeHTTPS(addr string, cache *diskcache.Cache, certFile, keyFile string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dir ¶
func Dir(cache *diskcache.Cache, dir string) http.FileSystem
Dir returns an http.FileSystem corresponding to the cached file subtree rooted at dir.
A typical use of Dir is to pass to http.FileServer to create an HTTP handler serving files from a cached subtree:
http.Handle("/static/", http.StripPrefix("/static", http.FileServer(cloud.Dir(cache, "/myfiles"))))
func LoadX509KeyPair ¶
LoadX509KeyPair is crypto/tls's LoadX509KeyPair, but it reads the key pair from cache instead of local disk.
Types ¶
This section is empty.
Directories
¶
Path | Synopsis |
---|---|
Package diskcache implements an on-disk cache of a remote file tree.
|
Package diskcache implements an on-disk cache of a remote file tree. |
google
|
|
gcs
Package gcs implements diskcache.Loader using Google Cloud Storage.
|
Package gcs implements diskcache.Loader using Google Cloud Storage. |
metaflag
Package metaflag sets command-line flags according to the metadata specified in a Google Compute Engine instance creation request.
|
Package metaflag sets command-line flags according to the metadata specified in a Google Compute Engine instance creation request. |