github.com/v2fly/v2ray-core/v4@v4.45.2/infra/control/uuid.go (about)

     1  package control
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/v2fly/v2ray-core/v4/common"
     7  	"github.com/v2fly/v2ray-core/v4/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 UUID",
    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  }