Пример #1
0
Файл: main.go Проект: uiri/brog
func doServer(isProd bool) {

	brog, err := brogger.PrepareBrog(isProd)
	if err != nil {
		printPreBrogError("Couldn't start brog server.\n")
		printPreBrogError("Message : %v.\n", err)
		printTryInitMessage()
		return
	}
	defer closeOrPanic(brog)

	err = brog.ListenAndServe()
	brog.Err("Whoops! %v.", err)

}
Пример #2
0
func doCreate(newPostFilename string) {
	brog, err := brogger.PrepareBrog(false)
	if err != nil {
		printPreBrogError("Couldn't create new post.\n")
		printPreBrogError("Message : %v.\n", err)
		printTryInitMessage()
		return
	}
	defer closeOrPanic(brog)

	err = brogger.CopyBlankToFilename(brog.Config, newPostFilename)
	if err != nil {
		brog.Err("Brog post creation failed, %v.", err)
		brog.Err("Why do you resist?")
		return
	}
	brog.Ok("'%s' will become one with the Brog.", newPostFilename)
}
Пример #3
0
Файл: main.go Проект: uiri/brog
func doInit() {
	fmt.Println(brush.DarkGray("A dark geometric shape is approaching..."))
	errs := brogger.CopyBrogBinaries()
	if len(errs) != 0 {
		printPreBrogError("Couldn't inject brog nanoprobes.\n")
		for _, err := range errs {
			printPreBrogError("Message : %v.\n", err)
		}
		return
	}

	brog, err := brogger.PrepareBrog(false)
	if len(errs) != 0 {
		printPreBrogError("Couldn't prepare brog structure.\n")
		printPreBrogError("Message : %v.\n", err)
		return
	}
	brog.Ok("Initiliazing a brog. Resistance is futile.")

	defer closeOrPanic(brog)
	brog.Ok("Brog nanoprobes implanted.")
}