github.com/Uhtred009/v2ray-core-1@v4.31.2+incompatible/infra/control/uuid.go (about)

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