Documentation ¶
Overview ¶
Package server implements the server HTTP interface for the UI, publishing, setup, status, sync, thubnailing, etc.
#fileembed pattern .+\.(ico)$
Index ¶
- Variables
- type DownloadHandler
- type FileTreeHandler
- type ImageHandler
- type PublishHandler
- type RootHandler
- type SetupHandler
- type StatusHandler
- type SyncHandler
- func (sh *SyncHandler) EnumerateBlobs(ctx *context.Context, dest chan<- blob.SizedRef, after string, limit int) error
- func (sh *SyncHandler) Fetch(blob.Ref) (file io.ReadCloser, size uint32, err error)
- func (sh *SyncHandler) InitHandler(hl blobserver.FindHandlerByTyper) error
- func (sh *SyncHandler) ReceiveBlob(br blob.Ref, r io.Reader) (sb blob.SizedRef, err error)
- func (sh *SyncHandler) RemoveBlobs(blobs []blob.Ref) error
- func (sh *SyncHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
- func (sh *SyncHandler) StatBlobs(dest chan<- blob.SizedRef, blobs []blob.Ref) error
- func (sh *SyncHandler) String() string
- type UIHandler
Constants ¶
This section is empty.
Variables ¶
var Files = &fileembed.Files{}
Functions ¶
This section is empty.
Types ¶
type DownloadHandler ¶
type DownloadHandler struct { Fetcher blob.Fetcher Cache blobserver.Storage ForceMime string // optional }
func (*DownloadHandler) ServeHTTP ¶
func (dh *DownloadHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request, file blob.Ref)
type FileTreeHandler ¶
func (*FileTreeHandler) ServeHTTP ¶
func (fth *FileTreeHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
type ImageHandler ¶
type ImageHandler struct { Fetcher blob.Fetcher 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 Prefix string // root handler's prefix 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 {
// contains filtered or unexported fields
}
StatusHandler publishes server status information.
func (*StatusHandler) ServeHTTP ¶
func (sh *StatusHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
type SyncHandler ¶
type SyncHandler struct {
// 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) EnumerateBlobs ¶
func (*SyncHandler) Fetch ¶
func (sh *SyncHandler) Fetch(blob.Ref) (file io.ReadCloser, size uint32, err error)
func (*SyncHandler) InitHandler ¶
func (sh *SyncHandler) InitHandler(hl blobserver.FindHandlerByTyper) error
func (*SyncHandler) ReceiveBlob ¶
func (*SyncHandler) RemoveBlobs ¶
func (sh *SyncHandler) RemoveBlobs(blobs []blob.Ref) error
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.