flags.go 935 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package daemon
  2. import (
  3. "git.beejay.kim/tool/service/config"
  4. "github.com/urfave/cli/v2"
  5. )
  6. var flags = []cli.Flag{
  7. &cli.PathFlag{
  8. Name: "config",
  9. Usage: "config file path",
  10. Required: true,
  11. Aliases: []string{"C"},
  12. TakesFile: false,
  13. Action: config.Load[Configuration],
  14. },
  15. &cli.StringFlag{
  16. Name: "topic",
  17. Usage: "kafka producer topic name",
  18. Required: true,
  19. Destination: &topic,
  20. Aliases: []string{"T"},
  21. },
  22. &cli.StringFlag{
  23. Name: "pid",
  24. Usage: "platform ID",
  25. Required: true,
  26. Destination: &pid,
  27. },
  28. &cli.StringFlag{
  29. Name: "bid",
  30. Usage: "broadcaster ID",
  31. Required: true,
  32. Destination: &bid,
  33. },
  34. &cli.PathFlag{
  35. Name: "record",
  36. TakesFile: false,
  37. Destination: &pathRecord,
  38. },
  39. &cli.StringFlag{
  40. Name: "player",
  41. Usage: "whether we want to watch stream in realtime",
  42. Destination: &pathPlayer,
  43. },
  44. }