github.com/machinefi/w3bstream@v1.6.5-rc9.0.20240426031326-b8c7c4876e72/pkg/wsctl/cmd/applet/applet.go (about)

     1  package applet
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/spf13/cobra"
     7  
     8  	"github.com/machinefi/w3bstream/pkg/wsctl/client"
     9  	"github.com/machinefi/w3bstream/pkg/wsctl/config"
    10  )
    11  
    12  // Multi-language support
    13  var (
    14  	_appletCmdShorts = map[config.Language]string{
    15  		config.English: "Manage applets of W3bstream",
    16  		config.Chinese: "管理 W3bstream 系统里的 applets",
    17  	}
    18  )
    19  
    20  // NewAppletCmd represents the new applet command.
    21  func NewAppletCmd(client client.Client) *cobra.Command {
    22  	cmd := &cobra.Command{
    23  		Use:   "applet",
    24  		Short: client.SelectTranslation(_appletCmdShorts),
    25  	}
    26  	cmd.AddCommand(newAppletDeleteCmd(client))
    27  	cmd.AddCommand(newAppletCreateCmd(client))
    28  	return cmd
    29  }
    30  
    31  func GetAppletCmdUrl(endpoint, cmd string) string {
    32  	return fmt.Sprintf("%s/srv-applet-mgr/v0/applet/%s", endpoint, cmd)
    33  }