Example #1
0
func main() {
	/*
	  use basic setup
	*/
	thrust.InitLogger()
	// Set any Custom Provisioners before Start
	thrust.SetProvisioner(tutorial.NewTutorialProvisioner())
	// thrust.Start() must always come before any bindings are created.
	thrust.Start()

	/*
	   Start of Basic Session Tutorial area
	*/
	// arguments (incognito, useDisk)
	mysession := thrust.NewSession(false, false, "./cache")
	//mysession.SetInvokable(*session.NewDummySession())
	/*
	  Modified basic_window, where we provide, a session argument
	  to NewWindow.
	*/
	thrustWindow := thrust.NewWindow(thrust.WindowOptions{
		RootUrl: "http://breach.cc/",
		Session: mysession,
	})
	thrustWindow.Show()
	thrustWindow.Maximize()
	thrustWindow.Focus()

	// BLOCKING - Dont run before youve excuted all commands you want first.
	thrust.LockThread()
}
func main() {
	http.HandleFunc("/", handler)
	thrust.InitLogger()
	// Set any Custom Provisioners before Start
	thrust.SetProvisioner(tutorial.NewTutorialProvisioner())
	// thrust.Start() must always come before any bindings are created.
	thrust.Start()

	mysession := thrust.NewSession(false, false, "cache")

	thrustWindow := thrust.NewWindow(thrust.WindowOptions{
		RootUrl: "http://localhost:8080/",
		Session: mysession,
	})
	thrustWindow.Show()
	thrustWindow.Maximize()
	thrustWindow.Focus()

	// See, we dont use thrust.LockThread() because we now have something holding the process open
	http.ListenAndServe(":8080", nil)
}
Example #3
0
func main() {
	/*
	   use basic setup
	*/
	thrust.InitLogger()
	// Set any Custom Provisioners before Start
	thrust.SetProvisioner(tutorial.NewTutorialProvisioner())
	// thrust.Start() must always come before any bindings are created.
	thrust.Start()

	/*
			  Start of Advanced Session Tutorial.
			  We are going to set the Override value to true as ooposed to the false
			  used in basic_session. This will cause ThrustCore to try to invoke methods from us.

		    Look down below func main to find our session class.
	*/
	mysession := thrust.NewSession(false, true, "session_cache")

	mysession.SetInvokable(NewSimpleSession())
	/*
	   Modified basic_window, where we provide, a session argument
	   to NewWindow.
	*/
	thrustWindow := thrust.NewWindow(thrust.WindowOptions{
		RootUrl: "http://breach.cc/",
		Session: mysession,
	})
	thrustWindow.Show()
	thrustWindow.Maximize()
	thrustWindow.Focus()

	// In lieu of something like an http server, we need to lock this thread
	// in order to keep it open, and keep the process running.
	// Dont worry we use runtime.Gosched :)
	thrust.LockThread()
}