package main import ( "stream_server/rtmp" "stream_server/http" "stream_server/srt" ) const ( SRVTYPE_RTMP uint8 = iota SRVTYPE_SRT ) func main() { err := NewIngestServer(SRVTYPE_SRT, "7878") if err != nil { panic(err) } err = NewHTTPServer("7879") if err != nil { panic(err) } for { } } func NewIngestServer(srvr_type uint8, port string) (error) { var err error switch srvr_type { case 0: err = rtmp.NewServer(port) case 1: err = srt.NewServer(port) } return err } func NewHTTPServer(port string) (error) { err := http.NewServer(port) return err }