Documentation ¶
Overview ¶
Package proto defines the protocol between appfs client and server.
Index ¶
Constants ¶
const CreateURL = "/.appfs/create/"
POST to /.appfs/create/path creates a new file or directory. The named path must not already exist; its parent must exist. The query parameter dir=1 indicates that a directory should be created.
const MkfsURL = "/.appfs/mkfs"
POST to /.appfs/mount initializes the file system if it does not yet exist in the datastore.
const PostContentType = "x-appfs/raw"
PostContentType is the Content-Type for POSTed data. There is no encoding or framing: it is just raw data bytes.
const ReadURL = "/.appfs/read/"
GET /.appfs/read/path returns the content of the file or directory. The body of the response is the raw file or directory content. The content of a directory is a sequence of JSON-encoded FileInfo.
const RemoveURL = "/.appfs/remove/"
POST to /.appfs/remove/path removes the file or directory. A directory must be empty to be removed.
const StatURL = "/.appfs/stat/"
GET /.appfs/stat/path returns the metadata for a file or directory, a JSON-encoded FileInfo.
const WriteURL = "/.appfs/write/"
POST to /.appfs/write/path writes new data to a file. The X-Appfs-SHA1 header is the SHA1 hash of the data. The body of the request is the raw file content.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct {
Password string
}
An Auth appears, JSON-encoded, as the X-Appfs-Auth header line, to authenticate a request made to the file server. The authentication scheme could be made more sophisticated, but since we are already forcing the use of TLS, a plain password is fine for now.