rclone: github.com/ncw/rclone/cmd/serve/httplib/serve Index | Files | Directories

package serve

import "github.com/ncw/rclone/cmd/serve/httplib/serve"

Package serve deals with serving objects over HTTP

Index

Package Files

dir.go serve.go

func Error Uses

func Error(what interface{}, w http.ResponseWriter, text string, err error)

Error returns an http.StatusInternalServerError and logs the error

func Object Uses

func Object(w http.ResponseWriter, r *http.Request, o fs.Object)

Object serves an fs.Object via HEAD or GET

type DirEntry Uses

type DirEntry struct {
    URL  string
    Leaf string
    // contains filtered or unexported fields
}

DirEntry is a directory entry

type Directory Uses

type Directory struct {
    DirRemote    string
    Title        string
    Entries      []DirEntry
    Query        string
    HTMLTemplate *template.Template
}

Directory represents a directory

func NewDirectory Uses

func NewDirectory(dirRemote string, htmlTemplate *template.Template) *Directory

NewDirectory makes an empty Directory

func (*Directory) AddEntry Uses

func (d *Directory) AddEntry(remote string, isDir bool)

AddEntry adds an entry to that directory

func (*Directory) Serve Uses

func (d *Directory) Serve(w http.ResponseWriter, r *http.Request)

Serve serves a directory

func (*Directory) SetQuery Uses

func (d *Directory) SetQuery(queryParams url.Values) *Directory

SetQuery sets the query parameters for each URL

Directories

PathSynopsis
data

Package serve imports 10 packages (graph) and is imported by 7 packages. Updated 2019-06-25. Refresh now. Tools for package owners.