gitlab.com/evatix-go/core@v1.3.55/chmodhelper/Variant.go (about)

     1  package chmodhelper
     2  
     3  type Variant string
     4  
     5  //goland:noinspection ALL
     6  const (
     7  	AllRead                             Variant = "444"
     8  	AllWrite                            Variant = "222"
     9  	AllExecute                          Variant = "111"
    10  	AllReadWrite                        Variant = "666"
    11  	AllReadExecute                      Variant = "555"
    12  	AllWriteExecute                     Variant = "333"
    13  	OwnerAllReadWriteGroupOther         Variant = "755"
    14  	ReadWriteOwnerReadGroupOther        Variant = "644"
    15  	ReadWriteOwnerReadExecuteGroupOther Variant = "655"
    16  	X111                                Variant = "111"
    17  	X222                                Variant = "222"
    18  	X333                                Variant = "333"
    19  	X444                                Variant = "444"
    20  	X555                                Variant = "555"
    21  	X644                                Variant = "644"
    22  	X655                                Variant = "655"
    23  	X666                                Variant = "666"
    24  	X677                                Variant = "677"
    25  	X711                                Variant = "711"
    26  	X722                                Variant = "722"
    27  	X733                                Variant = "733"
    28  	X744                                Variant = "744"
    29  	X755                                Variant = "755"
    30  	X766                                Variant = "766"
    31  	X777                                Variant = "777"
    32  )
    33  
    34  func (it Variant) String() string {
    35  	return string(it)
    36  }
    37  
    38  // ExpandOctalByte
    39  //
    40  //  returns byte values at most 7 for each.
    41  func (it Variant) ExpandOctalByte() (r7, w7, x7 byte) {
    42  	return ExpandCharRwx(string(it))
    43  }
    44  
    45  func (it Variant) ToWrapper() (RwxWrapper, error) {
    46  	return New.RwxWrapper.UsingVariant(it)
    47  }
    48  
    49  func (it Variant) ToWrapperPtr() (*RwxWrapper, error) {
    50  	return New.RwxWrapper.UsingVariantPtr(it)
    51  }