Documentation ¶
Index ¶
- Variables
- func NewTar(dir string, w io.Writer, options ...Option) error
- func OptAppendFile(name string, mode os.FileMode, r io.Reader) appendFileOpt
- func OptGID(gid int) setGIDOption
- func OptUID(uid int) setUIDOption
- func Serve(address, prefix, sourceDir, appendFilename string) error
- type Option
- type PathFunc
- type PathRewriteFunc
- type TarHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoDir = errors.New("no directory")
ErrNoDir is returned if a given path is not a directory.
View Source
var OptAbsolute = new(optAbsolute)
OptAbsolute will rebase the tar file for absolute original paths.
View Source
var OptNumericIDs = new(optNumericIDs)
OptNumericIDs sets all IDs to numeric.
View Source
var OptRelative = new(optRelative)
OptRelative will rebase the tar file to relative paths.
Functions ¶
func NewTar ¶
NewTar creates a tar stream written to w that contains dir. It will have paths as determined by pathType.
func OptAppendFile ¶
OptAppendFile appends a file to the tar with the given name and content read from r.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is an option for tarfile creation.
func OptByteSeek ¶
type PathFunc ¶
type PathFunc func(base string) PathRewriteFunc
PathFunc creates a function for rewriting paths.
type TarHandler ¶
TarHandler is a http.Handler that serves a sub-directory of SourceDir (only last
func (*TarHandler) Handler ¶
func (handler *TarHandler) Handler(w http.ResponseWriter, r *http.Request)
func (*TarHandler) ServeHTTP ¶
func (handler *TarHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.