web

package
v0.0.0-...-7c4ed6d Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2017 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package web provides an http.Handler implementation that serves content from the Upspin namespace. For example, an HTTP request for

http://host.example.com/user@example.com/foo

returns the Upspin file

user@example.com/foo

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg upspin.Config, perm IsWriter) http.Handler

New returns an http.Handler that serves the Upspin names identified by the request path. For example, a request for a URL with the path "/user@example.com/file" returns the content available at that Upspin path (without the leading slash).

The handler will only serve the Upspin trees of users that are considered Writers by the given IsWriter.

Types

type IsWriter

type IsWriter interface {
	IsWriter(upspin.UserName) bool
}

IsWriter is a method provided by serverutil/perm.Perm, but in the context of this package the method determines whether a user's Upspin tree should be served through this web interface.

Jump to

Keyboard shortcuts

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