Documentation ¶
Index ¶
- Variables
- func CreateArchive(archiveType ArchiveType, contentPath string) (string, string, error)
- func Execute(cmdline []string, env ...string) error
- func FindInFile(path string, query string) []string
- func ReplaceMultiple(text string, replacements map[string]string) string
- type ArchiveType
- type BodyReader
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ZIP = ArchiveType{ func(w io.Writer) archiveBase { zipWriter := zip.NewWriter(w) zipWriter.RegisterCompressor( zip.Deflate, func(w io.Writer) (io.WriteCloser, error) { return flate.NewWriter(w, flate.BestCompression) }) return &archiveZip{zipWriter} }, "zip"} TGZ = ArchiveType{ func(w io.Writer) archiveBase { if gzWriter, err := gzip.NewWriterLevel(w, gzip.BestCompression); err == nil { return &archiveTgz{ tar.NewWriter(gzWriter), gzWriter} } return nil }, "tgz"} )
supported archive types
Functions ¶
func CreateArchive ¶
func CreateArchive( archiveType ArchiveType, contentPath string) (string, string, error)
Creates an archive of the given type with the content from contentPath.
Return values: archivePath, archiveHash, error
func FindInFile ¶
Types ¶
type ArchiveType ¶
type BodyReader ¶
type BodyReader struct {
io.LimitedReader
}
func BodyFromFile ¶
func BodyFromFile(path string) BodyReader
func BodyFromMap ¶
func BodyFromMap(data map[string]string) BodyReader
func (BodyReader) Length ¶
func (bodyReader BodyReader) Length() int64
Click to show internal directories.
Click to hide internal directories.