mirror of
https://github.com/andatoshiki/shikigrid.git
synced 2026-06-05 19:56:27 +00:00
39 lines
577 B
Go
39 lines
577 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
"github.com/evilsocket/islazy/log"
|
|
"github.com/andatoshiki/shikigrid/version"
|
|
)
|
|
|
|
func main() {
|
|
flag.Parse()
|
|
|
|
setupCore()
|
|
defer cleanup()
|
|
|
|
// just print the version and exit
|
|
if ver {
|
|
fmt.Println(version.Version)
|
|
return
|
|
}
|
|
|
|
// from here on we need logging
|
|
if err := log.Open(); err != nil {
|
|
panic(err)
|
|
}
|
|
defer log.Close()
|
|
|
|
// do mode related initialization
|
|
setupMode()
|
|
|
|
// if we're in peer mode and is an inbox action
|
|
if inbox {
|
|
inboxMain()
|
|
} else {
|
|
// just start the API in either modes
|
|
server.Run(address)
|
|
}
|
|
}
|