httpfs

package
v3.6.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2014 License: CC-BY-3.0, Freetype, GPL-3.0-or-later Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DirPerm  = 0777 // permissions for new directory
	FilePerm = 0666 // permissions for new files
)
View Source
const (
	APPEND action = "append"
	LS     action = "ls"
	MKDIR  action = "mkdir"
	PUT    action = "put"
	READ   action = "read"
	RM     action = "rm"
)
View Source
const BUFSIZE = 16 * 1024 * 1024 // bufio buffer size

Variables

View Source
var (
	Logging = false // enables logging

)

Functions

func Append

func Append(URL string, p []byte) error

func Handle

func Handle()

func Log

func Log(msg ...interface{})

func Mkdir

func Mkdir(URL string) error

Creates the directory at specified URL (or local file), creating all needed parent directories as well.

func MustOpen

func MustOpen(URL string) io.ReadCloser

func Open

func Open(URL string) (io.ReadCloser, error)

open a file for reading

func Put

func Put(URL string, p []byte) error

func Read

func Read(URL string) ([]byte, error)

func ReadDir

func ReadDir(URL string) ([]string, error)

func Remove

func Remove(URL string) error

func SetWD

func SetWD(dir string)

SetWD sets a "working directory", prefixed to all relative local paths. dir may start with "http://", turning local relative paths into remote paths. E.g.:

	http://path -> http://path
	path/file   -> wd/path/file
 /path/file  -> /path/file

func Touch

func Touch(URL string) error

Types

type WriteCloseFlusher

type WriteCloseFlusher interface {
	io.WriteCloser
	Flush() error
}

func Create

func Create(URL string) (WriteCloseFlusher, error)

create a file for writing, clobbers previous content if any.

func MustCreate

func MustCreate(URL string) WriteCloseFlusher

Jump to

Keyboard shortcuts

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