github.com/taubyte/tau-cli@v0.1.13-0.20240326000942-487f0d57edfc/cli/commands/resources/storage/new.go (about)

     1  package storage
     2  
     3  import (
     4  	structureSpec "github.com/taubyte/go-specs/structure"
     5  	resources "github.com/taubyte/tau-cli/cli/commands/resources/common"
     6  	"github.com/taubyte/tau-cli/cli/common"
     7  	"github.com/taubyte/tau-cli/flags"
     8  	storageFlags "github.com/taubyte/tau-cli/flags/storage"
     9  	storageI18n "github.com/taubyte/tau-cli/i18n/storage"
    10  	storageLib "github.com/taubyte/tau-cli/lib/storage"
    11  	storagePrompts "github.com/taubyte/tau-cli/prompts/storage"
    12  	storageTable "github.com/taubyte/tau-cli/table/storage"
    13  )
    14  
    15  func (link) New() common.Command {
    16  	return (&resources.New[*structureSpec.Storage]{
    17  		PromptsNew:        storagePrompts.New,
    18  		TableConfirm:      storageTable.Confirm,
    19  		PromptsCreateThis: storagePrompts.CreateThis,
    20  		LibNew:            storageLib.New,
    21  		I18nCreated:       storageI18n.Created,
    22  
    23  		UniqueFlags: flags.Combine(
    24  			flags.MatchRegex,
    25  			flags.Match,
    26  			storageFlags.Public,
    27  			flags.Size,
    28  			flags.SizeUnit,
    29  			storageFlags.BucketType,
    30  			storageFlags.Versioning, // BucketType Object
    31  			storageFlags.TTL,        // BucketType Streaming
    32  		),
    33  	}).Default()
    34  }