2023-11-30 18:32:38 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"git.t-juice.club/torjus/ministream/server"
|
|
|
|
"github.com/urfave/cli/v2"
|
|
|
|
)
|
|
|
|
|
2023-11-30 22:56:33 +00:00
|
|
|
const Version = "v0.1.1"
|
2023-11-30 18:32:38 +00:00
|
|
|
|
|
|
|
func main() {
|
|
|
|
app := cli.App{
|
|
|
|
Name: "ministream",
|
|
|
|
Usage: "Small livestreaming platform.",
|
|
|
|
Commands: []*cli.Command{
|
|
|
|
{
|
|
|
|
Name: "serve",
|
|
|
|
Usage: "Start livestreaming server.",
|
|
|
|
Action: func(ctx *cli.Context) error {
|
|
|
|
store := server.NewUserStore()
|
|
|
|
|
|
|
|
srv := server.NewServer(store)
|
|
|
|
srv.Addr = ":8080"
|
|
|
|
srv.ListenAndServe()
|
|
|
|
return nil
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Version: Version,
|
|
|
|
}
|
|
|
|
|
|
|
|
err := app.RunContext(context.Background(), os.Args)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
}
|
|
|
|
}
|