github.com/osievert/jfrog-cli-core@v1.2.7/artifactory/commands/generic/generic.go (about)

     1  package generic
     2  
     3  import (
     4  	commandsutils "github.com/jfrog/jfrog-cli-core/artifactory/commands/utils"
     5  	"github.com/jfrog/jfrog-cli-core/artifactory/spec"
     6  	"github.com/jfrog/jfrog-cli-core/utils/config"
     7  )
     8  
     9  type GenericCommand struct {
    10  	rtDetails       *config.ArtifactoryDetails
    11  	spec            *spec.SpecFiles
    12  	result          *commandsutils.Result
    13  	dryRun          bool
    14  	detailedSummary bool
    15  	syncDeletesPath string
    16  	quiet           bool
    17  }
    18  
    19  func NewGenericCommand() *GenericCommand {
    20  	return &GenericCommand{result: new(commandsutils.Result)}
    21  }
    22  
    23  func (gc *GenericCommand) DryRun() bool {
    24  	return gc.dryRun
    25  }
    26  
    27  func (gc *GenericCommand) SetDryRun(dryRun bool) *GenericCommand {
    28  	gc.dryRun = dryRun
    29  	return gc
    30  }
    31  
    32  func (gc *GenericCommand) SyncDeletesPath() string {
    33  	return gc.syncDeletesPath
    34  }
    35  
    36  func (gc *GenericCommand) SetSyncDeletesPath(syncDeletes string) *GenericCommand {
    37  	gc.syncDeletesPath = syncDeletes
    38  	return gc
    39  }
    40  
    41  func (gc *GenericCommand) Quiet() bool {
    42  	return gc.quiet
    43  }
    44  
    45  func (gc *GenericCommand) SetQuiet(quiet bool) *GenericCommand {
    46  	gc.quiet = quiet
    47  	return gc
    48  }
    49  
    50  func (gc *GenericCommand) Result() *commandsutils.Result {
    51  	return gc.result
    52  }
    53  
    54  func (gc *GenericCommand) Spec() *spec.SpecFiles {
    55  	return gc.spec
    56  }
    57  
    58  func (gc *GenericCommand) SetSpec(spec *spec.SpecFiles) *GenericCommand {
    59  	gc.spec = spec
    60  	return gc
    61  }
    62  
    63  func (gc *GenericCommand) RtDetails() (*config.ArtifactoryDetails, error) {
    64  	return gc.rtDetails, nil
    65  }
    66  
    67  func (gc *GenericCommand) SetRtDetails(rtDetails *config.ArtifactoryDetails) *GenericCommand {
    68  	gc.rtDetails = rtDetails
    69  	return gc
    70  }
    71  
    72  func (gc *GenericCommand) DetailedSummary() bool {
    73  	return gc.detailedSummary
    74  }
    75  
    76  func (gc *GenericCommand) SetDetailedSummary(detailedSummary bool) *GenericCommand {
    77  	gc.detailedSummary = detailedSummary
    78  	return gc
    79  }