cloud

package module
v0.0.0-...-b8f7586 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2015 License: BSD-3-Clause Imports: 9 Imported by: 2

README

go get [-u] rsc.io/cloud https://godoc.org/rsc.io/cloud

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

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

func LoadX509KeyPair(cache *diskcache.Cache, certFile, keyFile string) (tls.Certificate, error)

LoadX509KeyPair is crypto/tls's LoadX509KeyPair, but it reads the key pair from cache instead of local disk.

func ServeHTTP

func ServeHTTP(addr string, handler http.Handler) error

ServeHTTP invokes net/http's ListenAndServe; it is here only for symmetry with ServeHTTPS.

func ServeHTTPS

func ServeHTTPS(addr string, cache *diskcache.Cache, certFile, keyFile string, handler http.Handler) error

ServeHTTPS is net/http's ListenAndServeTLS, 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL