Documentation ¶
Index ¶
- Constants
- func BuildClasspath(files ...string) string
- func CopyZipFileToDisk(file *zip.File, dest string) error
- func Download(dst io.Writer, req *http.Request) error
- func DownloadTemp(req *http.Request, pattern string) (*os.File, error)
- func ExtractZipFileToDisk(zipFile *zip.Reader, dest string) error
- func GetClasspathSeparator() string
- func GetFileInZip(zipFile *zip.Reader, name string) (*zip.File, error)
- func MergeZips(into *zip.Writer, from *zip.Reader, files []string, filter func(string) bool) ([]string, error)
- func NewRequest(method, url string, body io.Reader) (*http.Request, error)
- func RunCommand(name string, arg ...string) error
Constants ¶
const (
UserAgent = "mcinstall/0.1.0"
)
Variables ¶
This section is empty.
Functions ¶
func BuildClasspath ¶
Creates a classpath string for the given files appropriate to the operating system currently running. For example, on macOS using BuildClasspath("x.jar", "y.jar") the output would be "x.jar:y.jar". However on Windows, the output would be "x.jar;y.jar".
func CopyZipFileToDisk ¶
Reads the given zip file, and writes it to the given destination.
func DownloadTemp ¶
Downloads the file, copying it to the given writer. The temporary file should be removed after usage.
func ExtractZipFileToDisk ¶
Extracts the given zip file to the local file system.
func GetClasspathSeparator ¶
func GetClasspathSeparator() string
Gets the classpath separator for the operating system currently running.
func GetFileInZip ¶
Gets the *zip.File of the given name in the given zip file.
func NewRequest ¶
See http.NewRequest Populates the Header with our User-Agent
func RunCommand ¶
Runs the given program, with given arguments, outputting to the console of this program.
Types ¶
This section is empty.