예제 #1
0
파일: upload.go 프로젝트: vosst/csi
func actionUpload(c *cli.Context) {
	mi, err := machine.DefaultIdentifier()

	if err != nil {
		fmt.Fprintf(os.Stderr, "Could not create default machine identifier")
		return
	}

	u, err := url.Parse(c.String(uploadFlagDest.Name))
	if err != nil {
		fmt.Fprintf(os.Stderr, "Destination needs to be a valid url")
		return
	}

	crashDir := c.String(uploadFlagCrashDir.Name)
	persister := crash.HttpReportPersister{*u, mi, &http.Client{}}

	crash.ForEachReportInDir(crashDir, UploadingVisitor{crashDir, os.Stdout, persister, c.Bool(uploadFlagCleanup.Name)})
}
예제 #2
0
파일: list.go 프로젝트: vosst/csi
func actionList(c *cli.Context) {
	crashDir := c.String(listFlagCrashDir.Name)
	fmt.Fprintf(os.Stdout, "Listing crash reports in %s:\n", crashDir)
	crash.ForEachReportInDir(crashDir, ListingVisitor{os.Stdout})
}