2023-07-26 21:15:39 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2023-07-31 12:27:40 +00:00
|
|
|
svcAddr := flag.String("svc-addr", "", "service to register in logjam")
|
2023-07-26 21:15:39 +00:00
|
|
|
src := flag.String("src", ":8080", "listenhost:listenPort")
|
|
|
|
logjamBaseUrl := flag.String("logjam-base-url", "https://example.com", "logjam base url(shouldn't end with /)")
|
|
|
|
targetRoom := flag.String("targetRoom", "testyroom", "target room")
|
|
|
|
|
|
|
|
flag.Parse()
|
|
|
|
|
|
|
|
if strings.HasSuffix(*logjamBaseUrl, "/") {
|
|
|
|
panic("logjam-base-url shouldn't end with /")
|
|
|
|
}
|
2023-07-31 12:27:40 +00:00
|
|
|
if strings.HasSuffix(*svcAddr, "/") {
|
|
|
|
panic("service address shouldn't end with /")
|
|
|
|
}
|
2023-07-26 21:15:39 +00:00
|
|
|
app := App{}
|
2023-07-31 12:27:40 +00:00
|
|
|
app.Init(*src, *svcAddr, *logjamBaseUrl, *targetRoom)
|
2023-07-26 21:15:39 +00:00
|
|
|
app.Run()
|
|
|
|
}
|