uuid.go 483 B

12345678910111213141516171819202122232425262728293031
  1. package control
  2. import (
  3. "fmt"
  4. "v2ray.com/core/common"
  5. "v2ray.com/core/common/uuid"
  6. )
  7. type UUIDCommand struct{}
  8. func (c *UUIDCommand) Name() string {
  9. return "uuid"
  10. }
  11. func (c *UUIDCommand) Description() Description {
  12. return Description{
  13. Short: "Generate new UUIDs",
  14. Usage: []string{"v2ctl uuid"},
  15. }
  16. }
  17. func (c *UUIDCommand) Execute([]string) error {
  18. u := uuid.New()
  19. fmt.Println(u.String())
  20. return nil
  21. }
  22. func init() {
  23. common.Must(RegisterCommand(&UUIDCommand{}))
  24. }