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

     1  package publisher
     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  	_publisherCmdShorts = map[config.Language]string{
    15  		config.English: "Manage publishers of W3bstream",
    16  		config.Chinese: "管理 W3bstream 系统里的 publishers",
    17  	}
    18  )
    19  
    20  // NewPublisherCmd represents the new publisher command.
    21  func NewPublisherCmd(client client.Client) *cobra.Command {
    22  	cmd := &cobra.Command{
    23  		Use:   "publisher",
    24  		Short: client.SelectTranslation(_publisherCmdShorts),
    25  	}
    26  	cmd.AddCommand(newPublisherDeleteCmd(client))
    27  	cmd.AddCommand(newPublisherCreateCmd(client))
    28  	return cmd
    29  }
    30  
    31  func GetPublisherCmdUrl(endpoint, cmd string) string {
    32  	return fmt.Sprintf("%s/srv-publisher-mgr/v0/publisher/%s", endpoint, cmd)
    33  }