Documentation
¶
Overview ¶
Package visage allows programs to expose files publicly with access control.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoAccess = errors.New("access denied")
)
Functions ¶
Types ¶
type FileSystem ¶
type FileSystem interface {
// String is a unique, descriptive identifier for this file system.
String() string
// Open the named file for reading.
Open(path string) (io.ReadCloser, error)
// Create should return a writer for the given path. It is left to specific
// implementations whether they want to allow users to overwrite existing files,
// or to return an error, or to implement something more sophisticated such as
// versioning.
Create(path string) (io.WriteCloser, error)
// Stat should behave as os.Stat. If the underlying file system implements
// symlinks, Stat should follow them and treat them as directories.
Stat(path string) (os.FileInfo, error)
// ReadDir should return all the entries in a given directory.
ReadDir(path string) ([]os.FileInfo, error)
}
FileSystem specifies the abstraction that backends must satisfy.
func NewDirectory ¶
func NewDirectory(path string) FileSystem
NewDirectory creates a FileSystem that serves files with the given path at the root.
func NewEncryptedDirectory ¶
func NewEncryptedDirectory(path string, recipients []*openpgp.Entity, signer *openpgp.Entity) FileSystem
NewEncryptedDirectory returns a FileSystem that serves files from the given root. Files are encrypted on disk, and optionally signed. Files are automatically decrypted when read.
type Share ¶
type Share struct {
// contains filtered or unexported fields
}
func (*Share) AddFileSystem ¶
func (s *Share) AddFileSystem(fs FileSystem) error
func (*Share) FileSystem ¶
func (s *Share) FileSystem(fs string) (FileSystem, error)
func (*Share) FileSystems ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
bin
|
|
|
visage
command
Visage is a very simple implementation of the visage library with the bad web UI.
|
Visage is a very simple implementation of the visage library with the bad web UI. |
|
oauth2
|
|
|
github
Package github provides OKs and tokens for GitHub authentication.
|
Package github provides OKs and tokens for GitHub authentication. |
|
google
Package google provides OKs and tokens for Google Single-Sign On.
|
Package google provides OKs and tokens for Google Single-Sign On. |
|
Package token implements a token-based OK.
|
Package token implements a token-based OK. |
|
Package web implements a simple web UI for visage.
|
Package web implements a simple web UI for visage. |
Click to show internal directories.
Click to hide internal directories.