proto

package
v0.0.0-...-03206cb Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2016 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package proto defines the protocol between appfs client and server.

Index

Constants

View Source
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.

View Source
const MkfsURL = "/.appfs/mkfs"

POST to /.appfs/mount initializes the file system if it does not yet exist in the datastore.

View Source
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.

View Source
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.

View Source
const RemoveURL = "/.appfs/remove/"

POST to /.appfs/remove/path removes the file or directory. A directory must be empty to be removed.

View Source
const StatURL = "/.appfs/stat/"

GET /.appfs/stat/path returns the metadata for a file or directory, a JSON-encoded FileInfo.

View Source
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.

type FileInfo

type FileInfo struct {
	Name    string // final path element
	ModTime time.Time
	Size    int64
	IsDir   bool
}

A FileInfo is a directory entry.

Jump to

Keyboard shortcuts

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