Documentation
¶
Overview ¶
Package server implements the server HTTP interface for the UI, publishing, setup, status, sync, thubnailing, etc.
#fileembed pattern .+\.(ico)$
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Files = &fileembed.Files{}
Functions ¶
This section is empty.
Types ¶
type DownloadHandler ¶
type DownloadHandler struct {
Fetcher blob.StreamingFetcher
Cache blobserver.Storage
ForceMime string // optional
}
func (*DownloadHandler) ServeHTTP ¶
func (dh *DownloadHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request, file blob.Ref)
type FileTreeHandler ¶
type FileTreeHandler struct {
Fetcher blob.StreamingFetcher
// contains filtered or unexported fields
}
func (*FileTreeHandler) ServeHTTP ¶
func (fth *FileTreeHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
type ImageHandler ¶
type ImageHandler struct {
Fetcher blob.StreamingFetcher
Cache blobserver.Storage // optional
MaxWidth, MaxHeight int
Square bool
// contains filtered or unexported fields
}
func (*ImageHandler) ServeHTTP ¶
func (ih *ImageHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request, file blob.Ref)
type PublishHandler ¶
type PublishHandler struct {
RootName string
Search *search.Handler
Storage blobserver.Storage // of blobRoot
Cache blobserver.Storage // or nil
CSSFiles []string
// contains filtered or unexported fields
}
PublishHandler publishes your info to the world, if permanodes have appropriate ACLs set. (everything is private by default)
func (*PublishHandler) NewRequest ¶
func (ph *PublishHandler) NewRequest(rw http.ResponseWriter, req *http.Request) *publishRequest
func (*PublishHandler) ServeHTTP ¶
func (ph *PublishHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
func (*PublishHandler) ViewerIsOwner ¶
func (ph *PublishHandler) ViewerIsOwner(req *http.Request) bool
type RootHandler ¶
type RootHandler struct {
// Stealth determines whether we hide from non-authenticated
// clients.
Stealth bool
OwnerName string // for display purposes only.
Username string // default user for mobile setup.
// URL prefixes (path or full URL) to the primary blob and
// search root.
BlobRoot string
SearchRoot string
Storage blobserver.Storage // of BlobRoot, or nil
// contains filtered or unexported fields
}
RootHandler handles serving the about/splash page.
func (*RootHandler) SearchHandler ¶
func (rh *RootHandler) SearchHandler() (h *search.Handler, ok bool)
func (*RootHandler) ServeHTTP ¶
func (rh *RootHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
type SetupHandler ¶
type SetupHandler struct {
// contains filtered or unexported fields
}
SetupHandler handles serving the wizard setup page.
func (*SetupHandler) ServeHTTP ¶
func (sh *SetupHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
type StatusHandler ¶
type StatusHandler struct {
}
StatusHandler publishes server status information.
func (*StatusHandler) ServeHTTP ¶
func (sh *StatusHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
type SyncHandler ¶
type SyncHandler struct {
blobserver.NoImplStorage
// contains filtered or unexported fields
}
The SyncHandler handles async replication in one direction between a pair storage targets, a source and target.
SyncHandler is a BlobReceiver but doesn't actually store incoming blobs; instead, it records blobs it has received and queues them for async replication soon, or whenever it can.
func (*SyncHandler) InitHandler ¶
func (sh *SyncHandler) InitHandler(hl blobserver.FindHandlerByTyper) error
func (*SyncHandler) ReceiveBlob ¶
func (*SyncHandler) ServeHTTP ¶
func (sh *SyncHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
func (*SyncHandler) String ¶
func (sh *SyncHandler) String() string
type UIHandler ¶
type UIHandler struct {
// JSONSignRoot is the optional path or full URL to the JSON
// Signing helper. Only used by the UI and thus necessary if
// UI is true.
// TODO(bradfitz): also move this up to the root handler,
// if we start having clients (like phones) that we want to upload
// but don't trust to have private signing keys?
JSONSignRoot string
// Cache optionally specifies a cache blob server, used for
// caching image thumbnails and other emphemeral data.
Cache blobserver.Storage // or nil
// contains filtered or unexported fields
}
UIHandler handles serving the UI and discovery JSON.