Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)| #include <Cocoa/Cocoa.h> | |
| extern void ButtonClick(void); | |
| @interface GoPasser : NSObject | |
| + (void)buttonClick:(id)sender; // this should call the cgo function defined in main.go | |
| @end | |
| void StartApp(void); |
| package main | |
| /* | |
| #cgo CFLAGS: -x objective-c | |
| #cgo LDFLAGS: -framework Cocoa | |
| #import <Cocoa/Cocoa.h> | |
| int | |
| StartApp(void) { | |
| [NSAutoreleasePool new]; |
Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)| ////////////////////////////// Routes ///////////////////////////////////////// | |
| routes.HandleFunc("/fb/auth",fbHandler) | |
| //This route will process response returned from the facebook Oauth process | |
| routes.HandleFunc("/fb/callback",fbCallbackHandler) | |
| //////////////////////////// FbOauth Handler ////////////////////////////////// | |
| func fbHandler(w http.ResponseWriter, r *http.Request) { |
| package main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "net/http" | |
| "net/url" | |
| "os" |