Ejemplo n.º 1
0
Archivo: main.go Proyecto: m120/minio
func main() {
	probe.Init() // Set project's root source path.
	probe.SetAppInfo("Release-Tag", minioReleaseTag)
	probe.SetAppInfo("Commit-ID", minioShortCommitID)
	if os.Getenv("DOCKERIMAGE") == "1" {
		probe.SetAppInfo("Docker-Image", "true")
	}

	app := registerApp()
	app.Before = func(c *cli.Context) error {
		// Sets new config folder.
		setGlobalConfigPath(c.GlobalString("config-folder"))

		// Valid input arguments to main.
		checkMainSyntax(c)

		// Migrate any old version of config / state files to newer format.
		migrate()

		return nil
	}
	app.ExtraInfo = func() map[string]string {
		return getSystemData()
	}

	app.RunAndExitOnError()
}
Ejemplo n.º 2
0
func (s *MySuite) TestProbe(c *C) {
	probe.Init() // Set project's root source path.
	probe.SetAppInfo("Release-Tag", "RELEASE.Sat-19-Sep-2015-06-15-16-GMT")
	es := testDummy2().Trace("TopOfStack")
	// Uncomment the following Println to visually test probe call trace.
	// fmt.Println("Expecting a simulated error here.", es)
	c.Assert(es, Not(Equals), nil)

	newES := es.Trace()
	c.Assert(newES, Not(Equals), nil)
}
Ejemplo n.º 3
0
func (s *MySuite) TestProbe(c *C) {
	probe.Init() // Set project's root source path.
	probe.SetAppInfo("Commit-ID", "7390cc957239")
	es := testDummy2().Trace("TopOfStack")
	// Uncomment the following Println to visually test probe call trace.
	// fmt.Println("Expecting a simulated error here.", es)
	c.Assert(es, Not(Equals), nil)

	newES := es.Trace()
	c.Assert(newES, Not(Equals), nil)
}
Ejemplo n.º 4
0
func main() {
	probe.Init() // Set project's root source path.
	probe.SetAppInfo("Release-Tag", minioReleaseTag)

	app := registerApp()
	app.Before = func(c *cli.Context) error {
		globalJSONFlag = c.GlobalBool("json")
		migrate()
		return nil
	}
	app.ExtraInfo = func() map[string]string {
		return getSystemData()
	}

	app.RunAndExitOnError()
}
Ejemplo n.º 5
0
func main() {
	// Initialize probe.
	probe.Init()
	// Include release tag in the debug dumps.
	probe.SetAppInfo("Commit", minioShortCommitID)

	app := registerApp()
	app.Before = func(c *cli.Context) error {
		globalJSONFlag = c.GlobalBool("json")
		return nil
	}
	app.ExtraInfo = func() map[string]string {
		return getSystemData()
	}

	app.RunAndExitOnError()
}
Ejemplo n.º 6
0
func main() {
	probe.Init() // Set project's root source path.
	probe.SetAppInfo("Release-Tag", minioReleaseTag)
	probe.SetAppInfo("Commit-ID", minioShortCommitID)
	if os.Getenv("DOCKERIMAGE") == "1" {
		probe.SetAppInfo("Docker-Image", "true")
	}

	app := registerApp()
	app.Before = func(c *cli.Context) error {
		globalJSONFlag = c.GlobalBool("json")
		migrate()
		return nil
	}
	app.ExtraInfo = func() map[string]string {
		return getSystemData()
	}

	app.RunAndExitOnError()
}
Ejemplo n.º 7
0
Archivo: main.go Proyecto: zhujo01/mc
func main() {
	probe.Init() // Set project's root source path.
	probe.SetAppInfo("Release-Tag", mcReleaseTag)

	app := registerApp()
	app.Before = registerBefore

	app.ExtraInfo = func() map[string]string {
		if _, e := ts.GetSize(); e != nil {
			globalQuietFlag = true
		}

		if globalDebugFlag {
			return getSystemData()
		}
		return make(map[string]string)
	}

	app.RunAndExitOnError()
}
Ejemplo n.º 8
0
Archivo: main.go Proyecto: fwessels/mc
func main() {
	probe.Init() // Set project's root source path.
	probe.SetAppInfo("Release-Tag", mcReleaseTag)
	probe.SetAppInfo("Commit", mcShortCommitID)

	contentdb.Init() // Load contentdb into memory.
	app := registerApp()
	app.Before = registerBefore

	app.ExtraInfo = func() map[string]string {
		if _, e := ts.GetSize(); e != nil {
			globalQuiet = true
		}
		if globalDebug {
			return getSystemData()
		}
		return make(map[string]string)
	}

	app.RunAndExitOnError()
}