github.com/CPtung/libcompose@v0.4.3/project/options/types.go (about)

     1  package options
     2  
     3  // Build holds options of compose build.
     4  type Build struct {
     5  	NoCache     bool
     6  	ForceRemove bool
     7  	Pull        bool
     8  }
     9  
    10  // Delete holds options of compose rm.
    11  type Delete struct {
    12  	RemoveVolume  bool
    13  	RemoveRunning bool
    14  }
    15  
    16  // Down holds options of compose down.
    17  type Down struct {
    18  	RemoveVolume  bool
    19  	RemoveImages  ImageType
    20  	RemoveOrphans bool
    21  }
    22  
    23  // Create holds options of compose create.
    24  type Create struct {
    25  	NoRecreate    bool
    26  	ForceRecreate bool
    27  	NoBuild       bool
    28  	ForceBuild    bool
    29  }
    30  
    31  // Run holds options of compose run.
    32  type Run struct {
    33  	Detached   bool
    34  	DisableTty bool
    35  }
    36  
    37  // Up holds options of compose up.
    38  type Up struct {
    39  	Create
    40  }
    41  
    42  // ImageType defines the type of image (local, all)
    43  type ImageType string
    44  
    45  // Valid indicates whether the image type is valid.
    46  func (i ImageType) Valid() bool {
    47  	switch string(i) {
    48  	case "", "local", "all":
    49  		return true
    50  	default:
    51  		return false
    52  	}
    53  }