webdav

package
v0.0.0-...-7570391 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const MethodPropFind = "PROPFIND"
View Source
const StatusOk = "HTTP/1.1 200 OK"

Variables

This section is empty.

Functions

func ParseURLPath

func ParseURLPath(p string) (string, string, error)

func Serve

func Serve(ctx context.Context, cfg *cli.CliConfig) error

func ServeOptions

func ServeOptions(w http.ResponseWriter)

func WriteError

func WriteError(w http.ResponseWriter, err error)

Types

type ContentServerMarshaler

type ContentServerMarshaler struct {
	OrigReq *http.Request
	CInfo   *cli.ConnectionInfo
}

func (ContentServerMarshaler) WriteResponse

func (m ContentServerMarshaler) WriteResponse(w http.ResponseWriter, basepath string, entry *Entry, listing Listing)

type Entry

type Entry struct {
	Id           uint64
	Name         string
	Size         int64
	ModifiedTime time.Time
	IsDir        bool
}

func INodeViewToEntry

func INodeViewToEntry(v *pb.INodeView) *Entry

type Error

type Error struct {
	HttpStatusCode int
	Context        string
	Err            error
}

func ErrorFromGrpc

func ErrorFromGrpc(e error, context string) Error

func (Error) Error

func (e Error) Error() string

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func (*Handler) EntryForPath

func (h *Handler) EntryForPath(ctx context.Context, conn *grpc.ClientConn, p string) (*Entry, error)

func (*Handler) ListingForId

func (h *Handler) ListingForId(ctx context.Context, conn *grpc.ClientConn, id uint64) (Listing, error)

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Handler) VhostListing

func (h *Handler) VhostListing() Listing

type HtmlMarshaler

type HtmlMarshaler struct{}

func (HtmlMarshaler) WriteResponse

func (m HtmlMarshaler) WriteResponse(w http.ResponseWriter, basepath string, entry *Entry, listing Listing)

type Listing

type Listing []*Entry

type Marshaler

type Marshaler interface {
	WriteResponse(w http.ResponseWriter, basepath string, entry *Entry, listing Listing)
}

type PropStatMarshaler

type PropStatMarshaler struct{}

func (PropStatMarshaler) WriteResponse

func (m PropStatMarshaler) WriteResponse(w http.ResponseWriter, basepath string, entry *Entry, listing Listing)

Jump to

Keyboard shortcuts

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