chmodhelper

package
v0.5.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2021 License: MIT Imports: 16 Imported by: 17

Documentation

Index

Constants

View Source
const (
	SingleRwxLengthString            = "3"
	HyphenedRwxLength                = constants.ArbitraryCapacity10
	HyphenedRwxLengthString          = constants.N10String
	FullRwxLengthWithoutHyphenString = constants.N9String
	FullRwxLengthWithoutHyphen       = constants.ArbitraryCapacity9
	SingleRwxLength                  = 3
	ReadValue                        = 4
	WriteValue                       = 2
	ExecuteValue                     = 1
	ReadWriteValue                   = ReadValue + WriteValue
	ReadExecuteValue                 = ReadValue + ExecuteValue
	WriteExecuteValue                = WriteValue + ExecuteValue
	ReadWriteExecuteValue            = ReadValue + WriteValue + ExecuteValue

	OwnerIndex        = 0
	GroupIndex        = 1
	OtherIndex        = 2
	ReadChar     byte = 'r'
	WriteChar    byte = 'w'
	ExecuteChar  byte = 'x'
	AllWildcards      = "***"
)

Reference : https://ss64.com/bash/chmod.html

Variables

This section is empty.

Functions

func ExpandCharRwx added in v0.5.4

func ExpandCharRwx(rwx string) (r, w, x byte)

ExpandCharRwx Expands to 'r', 'w', 'x'

func FileModeApplyChmod added in v0.5.5

func FileModeApplyChmod(
	fileMode os.FileMode,
	condition *chmodins.Condition,
	locations ...string,
) error

func GetExistingChmod

func GetExistingChmod(filePath string) (os.FileMode, error)

func GetFilesChmodRwxFullMap added in v0.5.5

func GetFilesChmodRwxFullMap(
	requestedPaths []string,
) (filePathToRwxMap *corestr.Hashmap, err error)

GetFilesChmodRwxFullMap returns filePath -> "-rwxrwxrwx"

func GetFilesChmodRwxFullMapDirect added in v0.5.5

func GetFilesChmodRwxFullMapDirect(requestedPaths ...string) (*corestr.Hashmap, error)

GetFilesChmodRwxFullMapDirect returns filePath -> "-rwxrwxrwx"

func GetRwxLengthError added in v0.4.1

func GetRwxLengthError(rwx string) error

func IsChmod added in v0.4.1

func IsChmod(location string, expectedHyphenedRwx string) bool

IsChmod expectedHyphenedRwx should be 10 chars example "-rwxrwxrwx"

func IsChmodEqualUsingRwxOwnerGroupOther added in v0.4.1

func IsChmodEqualUsingRwxOwnerGroupOther(
	location string,
	rwx *chmodins.RwxOwnerGroupOther,
) bool

func NewRwxInstruction added in v0.5.5

func NewRwxInstruction(
	rwxFullString string,
	condition chmodins.Condition,
) (*chmodins.RwxInstruction, error)

NewRwxInstruction rwxFullString must be 10 chars in "-rwxrwxrwx"

func ParseRwxInstructionToStringRwx added in v0.4.1

func ParseRwxInstructionToStringRwx(
	rwxInstruction *chmodins.RwxOwnerGroupOther,
	isIncludeHyphen bool,
) string

func RwxOwnerGroupOtherApplyChmod added in v0.5.6

func RwxOwnerGroupOtherApplyChmod(
	rwxOwnerGroupOther *chmodins.RwxOwnerGroupOther,
	condition *chmodins.Condition,
	locations ...string,
) error

RwxOwnerGroupOtherApplyChmod rwxFullString 10 chars "-rwxrwxrwx"

func RwxStringApplyChmod added in v0.5.5

func RwxStringApplyChmod(
	rwxFullString string,
	condition *chmodins.Condition,
	locations ...string,
) error

RwxStringApplyChmod rwxFullString 10 chars "-rwxrwxrwx"

func RwxWildcardStringApplyChmod added in v0.5.6

func RwxWildcardStringApplyChmod(
	rwxPartial string,
	condition *chmodins.Condition,
	locations ...string,
) error

RwxWildcardStringApplyChmod rwxPartial can be any length in between 0-10 (rest will be fixed by wildcard)

rwxPartial:

  • "rwx" will be "-rwx******"
  • "rwxr-x" will be "-rwxr-x***"
  • "-rwxr-x" will be "-rwxr-x***"

func VerifyChmod added in v0.4.1

func VerifyChmod(location string, expectedHyphenedRwx string) error

VerifyChmod - expectedHyphenedRwx should be 10 chars example "-rwxrwxrwx"

func VerifyChmodPaths added in v0.4.1

func VerifyChmodPaths(
	locations *[]string,
	expectedHyphenedRwx string,
	isContinueOnError bool,
) error

func VerifyChmodPathsDirect added in v0.5.6

func VerifyChmodPathsDirect(
	expectedHyphenedRwx string,
	isContinueOnError bool,
	locations ...string,
) error

VerifyChmodMany - expectedHyphenedRwx should be 10 chars example "-rwxrwxrwx"

Multiple files verification error will be returned as once.

func VerifyChmodUsingHashmap added in v0.5.6

func VerifyChmodUsingHashmap(
	filePathToRwxMap *corestr.Hashmap,
) error

VerifyChmodUsingHashmap - expectedHyphenedRwx should be 10 chars example "-rwxrwxrwx"

Multiple files verification error will be returned as once. nil will be returned if no error

func VerifyChmodUsingRwxOwnerGroupOther added in v0.4.1

func VerifyChmodUsingRwxOwnerGroupOther(
	location string,
	rwx *chmodins.RwxOwnerGroupOther,
) error

Types

type AttrVariant

type AttrVariant byte

AttrVariant

1 - Execute true 2 - Write true 3 - Write + Execute true 4 - Read true 5 - Read + Execute true 6 - Read + Write true 7 - Read + Write + Execute all true

const (
	Execute          AttrVariant = 1
	Write            AttrVariant = 2
	WriteExecute     AttrVariant = 3
	Read             AttrVariant = 4
	ReadExecute      AttrVariant = 5
	ReadWrite        AttrVariant = 6
	ReadWriteExecute AttrVariant = 7
)

func (AttrVariant) IsGreaterThan

func (attrVariant AttrVariant) IsGreaterThan(v byte) bool

IsGreaterThan v > byte(attrVariant)

func (AttrVariant) String

func (attrVariant AttrVariant) String() string

func (AttrVariant) ToAttribute

func (attrVariant AttrVariant) ToAttribute() Attribute

func (AttrVariant) Value

func (attrVariant AttrVariant) Value() byte

type Attribute

type Attribute struct {
	IsRead    bool
	IsWrite   bool
	IsExecute bool
}

func MergeRwxWildcardWithFixedRwx added in v0.4.1

func MergeRwxWildcardWithFixedRwx(
	existingRwx,
	rwxWildcardInput string,
) (
	fixedAttribute *Attribute,
	err error,
)

MergeRwxWildcardWithFixedRwx

  • existingRwx : Usually refers to fixed rwx values like "rwx", "--x", "-w-" etc.
  • rwxWildcardInput : Usually refers to fixed rwx values like "rw*", "*-x", "-w-" etc. Wildcard means keep the existing value as is.

func NewAttribute

func NewAttribute(isRead, isWrite, isExecute bool) Attribute

func NewAttributeUsingByte

func NewAttributeUsingByte(v byte) Attribute

NewAttributeUsingByte

1 - Execute true 2 - Write true 3 - Write + Execute true 4 - Read true 5 - Read + Execute true 6 - Read + Write true 7 - Read + Write + Execute all true

func NewAttributeUsingRwx

func NewAttributeUsingRwx(rwx string) Attribute

NewAttributeUsingRwx Length must be 3 "rwx" should be put for attributes. eg. read enable all disable : "r--" eg. write enable all disable : "-w-" eg. execute enable all disable : "--x" eg. all enabled : "rwx"

func NewAttributeUsingVariant

func NewAttributeUsingVariant(v AttrVariant) Attribute

func (*Attribute) Clone added in v0.5.4

func (attribute *Attribute) Clone() *Attribute

func (*Attribute) ToAttributeValue

func (attribute *Attribute) ToAttributeValue() AttributeValue

func (*Attribute) ToByte

func (attribute *Attribute) ToByte() byte

ToByte refers to the compiled byte value in between 0-7

func (*Attribute) ToRwx

func (attribute *Attribute) ToRwx() [3]byte

func (*Attribute) ToRwxString

func (attribute *Attribute) ToRwxString() string

ToRwxString returns "rwx"

func (*Attribute) ToSpecificBytes

func (attribute *Attribute) ToSpecificBytes() (read, write, exe, sum byte)

func (*Attribute) ToStringByte added in v0.4.4

func (attribute *Attribute) ToStringByte() byte

ToStringByte returns the compiled byte value as Char byte value

It is not restricted between 0-7 but 0-7 + char '0', which makes it string 0-7

func (*Attribute) ToSum

func (attribute *Attribute) ToSum() byte

ToSum refers to the compiled byte value in between 0-7

func (*Attribute) ToVariant

func (attribute *Attribute) ToVariant() AttrVariant

type AttributeValue

type AttributeValue struct {
	Read, Write, Execute, Sum byte
}

type RwxInstructionExecutor added in v0.4.1

type RwxInstructionExecutor struct {
	// contains filtered or unexported fields
}

func ParseRwxInstructionToExecutor added in v0.4.1

func ParseRwxInstructionToExecutor(
	rwxInstruction *chmodins.RwxInstruction,
) (
	*RwxInstructionExecutor, error,
)

func RwxWildcardStringToInstructionExecutor added in v0.5.6

func RwxWildcardStringToInstructionExecutor(
	rwxPartial string,
	condition *chmodins.Condition,
) (*RwxInstructionExecutor, error)

RwxWildcardStringToInstructionExecutor rwxPartial can be any length in between 0-10 (rest will be fixed by wildcard)

rwxPartial:

  • "rwx" will be "-rwx******"
  • "rwxr-x" will be "-rwxr-x***"
  • "-rwxr-x" will be "-rwxr-x***"

func (*RwxInstructionExecutor) ApplyOnPath added in v0.4.1

func (receiver *RwxInstructionExecutor) ApplyOnPath(location string) error

func (*RwxInstructionExecutor) ApplyOnPaths added in v0.4.1

func (receiver *RwxInstructionExecutor) ApplyOnPaths(locations []string) error

func (*RwxInstructionExecutor) ApplyOnPathsDirect added in v0.5.5

func (receiver *RwxInstructionExecutor) ApplyOnPathsDirect(locations ...string) error

func (*RwxInstructionExecutor) ApplyOnPathsPtr added in v0.5.4

func (receiver *RwxInstructionExecutor) ApplyOnPathsPtr(locations *[]string) error

func (*RwxInstructionExecutor) CompiledRwxWrapperUsingFixedRwxWrapper added in v0.5.0

func (receiver *RwxInstructionExecutor) CompiledRwxWrapperUsingFixedRwxWrapper(
	wrapper *RwxWrapper,
) (*RwxWrapper, error)

func (*RwxInstructionExecutor) CompiledWrapper added in v0.4.1

func (receiver *RwxInstructionExecutor) CompiledWrapper(mode os.FileMode) (*RwxWrapper, error)

func (*RwxInstructionExecutor) IsFixedWrapper added in v0.4.1

func (receiver *RwxInstructionExecutor) IsFixedWrapper() bool

IsFixedWrapper true indicates no wildcard symbol

func (*RwxInstructionExecutor) IsVarWrapper added in v0.4.1

func (receiver *RwxInstructionExecutor) IsVarWrapper() bool

IsVarWrapper if it has any wildcard symbol in it

type RwxInstructionExecutors added in v0.4.1

type RwxInstructionExecutors struct {
	// contains filtered or unexported fields
}

func NewRwxInstructionExecutors added in v0.4.1

func NewRwxInstructionExecutors(capacity int) *RwxInstructionExecutors

func ParseBaseRwxInstructionsToExecutors added in v0.4.1

func ParseBaseRwxInstructionsToExecutors(
	baseRwxInstructions *chmodins.BaseRwxInstructions,
) (
	*RwxInstructionExecutors, error,
)

func ParseRwxInstructionsToExecutors added in v0.4.1

func ParseRwxInstructionsToExecutors(
	rwxInstructions *[]*chmodins.RwxInstruction,
) (
	*RwxInstructionExecutors, error,
)

func (*RwxInstructionExecutors) Add added in v0.4.1

func (receiver *RwxInstructionExecutors) Add(
	rwxInstructionExecutor *RwxInstructionExecutor,
) *RwxInstructionExecutors

Add skips nil

func (*RwxInstructionExecutors) Adds added in v0.4.1

func (receiver *RwxInstructionExecutors) Adds(
	rwxInstructionExecutors ...*RwxInstructionExecutor,
) *RwxInstructionExecutors

Adds skips nil

func (*RwxInstructionExecutors) ApplyOnPath added in v0.4.1

func (receiver *RwxInstructionExecutors) ApplyOnPath(location string) error

func (*RwxInstructionExecutors) ApplyOnPaths added in v0.4.1

func (receiver *RwxInstructionExecutors) ApplyOnPaths(locations []string) error

func (*RwxInstructionExecutors) ApplyOnPathsPtr added in v0.5.4

func (receiver *RwxInstructionExecutors) ApplyOnPathsPtr(locations *[]string) error

func (*RwxInstructionExecutors) Count added in v0.4.1

func (receiver *RwxInstructionExecutors) Count() int

func (*RwxInstructionExecutors) HasAnyItem added in v0.4.1

func (receiver *RwxInstructionExecutors) HasAnyItem() bool

func (*RwxInstructionExecutors) HasIndex added in v0.4.1

func (receiver *RwxInstructionExecutors) HasIndex(index int) bool

func (*RwxInstructionExecutors) IsEmpty added in v0.4.1

func (receiver *RwxInstructionExecutors) IsEmpty() bool

func (*RwxInstructionExecutors) Items added in v0.4.1

func (receiver *RwxInstructionExecutors) Items() *[]*RwxInstructionExecutor

func (*RwxInstructionExecutors) LastIndex added in v0.4.1

func (receiver *RwxInstructionExecutors) LastIndex() int

func (*RwxInstructionExecutors) Length added in v0.4.1

func (receiver *RwxInstructionExecutors) Length() int

type RwxVariableWrapper added in v0.4.4

type RwxVariableWrapper struct {
	Owner, Group, Other VarAttribute
	// contains filtered or unexported fields
}

func ParseRwxInstructionToVarWrapper added in v0.4.1

func ParseRwxInstructionToVarWrapper(
	rwxInstruction *chmodins.RwxInstruction,
) (
	*RwxVariableWrapper, error,
)

func ParseRwxOwnerGroupOtherToRwxVariableWrapper added in v0.4.4

func ParseRwxOwnerGroupOtherToRwxVariableWrapper(
	rwxOwnerGroupOther *chmodins.RwxOwnerGroupOther,
) (
	*RwxVariableWrapper, error,
)

func (*RwxVariableWrapper) Clone added in v0.5.4

func (varWrapper *RwxVariableWrapper) Clone() *RwxVariableWrapper

func (*RwxVariableWrapper) IsFixedType added in v0.4.4

func (varWrapper *RwxVariableWrapper) IsFixedType() bool

func (*RwxVariableWrapper) ToCompileFixedPtr added in v0.4.4

func (varWrapper *RwxVariableWrapper) ToCompileFixedPtr() *RwxWrapper

func (*RwxVariableWrapper) ToCompileWrapper added in v0.4.4

func (varWrapper *RwxVariableWrapper) ToCompileWrapper(fixed *RwxWrapper) RwxWrapper

ToCompileWrapper if Fixed type then fixed input can be nil.

func (*RwxVariableWrapper) ToCompileWrapperPtr added in v0.4.4

func (varWrapper *RwxVariableWrapper) ToCompileWrapperPtr(fixed *RwxWrapper) *RwxWrapper

ToCompileWrapperPtr if Fixed type then fixed input can be nil.

func (*RwxVariableWrapper) ToCompileWrapperUsingLocationPtr added in v0.5.5

func (varWrapper *RwxVariableWrapper) ToCompileWrapperUsingLocationPtr(location string) (*RwxWrapper, error)

type RwxWrapper added in v0.4.4

type RwxWrapper struct {
	Owner, Group, Other Attribute
}

func GetExistingChmodRwxWrapper added in v0.5.0

func GetExistingChmodRwxWrapper(
	filePath string,
) (RwxWrapper, error)

func GetExistingChmodRwxWrapperMustPtr added in v0.5.0

func GetExistingChmodRwxWrapperMustPtr(
	filePath string,
) *RwxWrapper

func GetExistingChmodRwxWrapperPtr added in v0.5.0

func GetExistingChmodRwxWrapperPtr(
	filePath string,
) (*RwxWrapper, error)

func New

func New(mode string) (RwxWrapper, error)

New mode length needs to 3, not more not less mode chars should be digits only (0-7) example "777", "755", "655"

func NewUsingAttrVariants

func NewUsingAttrVariants(owner, group, other AttrVariant) RwxWrapper

func NewUsingAttrs

func NewUsingAttrs(owner, group, other Attribute) RwxWrapper

func NewUsingByte

func NewUsingByte(owner, group, other byte) RwxWrapper

NewUsingByte each byte should not be more than 7

func NewUsingBytes

func NewUsingBytes(allBytes [3]byte) RwxWrapper

NewUsingBytes each byte should not be more than 7

func NewUsingFileMode

func NewUsingFileMode(fileMode os.FileMode) RwxWrapper

func NewUsingFileModePtr added in v0.4.1

func NewUsingFileModePtr(fileMode os.FileMode) *RwxWrapper

func NewUsingHyphenedRwxFullString added in v0.4.4

func NewUsingHyphenedRwxFullString(hyphenedRwxRwxRwx string) (RwxWrapper, error)

NewUsingHyphenedRwxFullString Format "-rwxrwxrwx"

eg. owener all enabled only "-rwx------"

eg. group all enabled only "----rwx---"

length must be 10 always.

Reference: https://ss64.com/bash/chmod.html

func NewUsingRwxFullString added in v0.4.4

func NewUsingRwxFullString(rwxFullStringWithoutHyphen string) (RwxWrapper, error)

NewUsingRwxFullString Format "rwxrwxrwx"

eg. owener all enabled only "rwx------"

eg. group all enabled only "---rwx---"

length must be 9 always.

func NewUsingRwxOwnerGroupOther added in v0.4.4

func NewUsingRwxOwnerGroupOther(
	rwxOwnerGroupOther *chmodins.RwxOwnerGroupOther,
) (RwxWrapper, error)

func NewUsingVariant

func NewUsingVariant(variant Variant) (RwxWrapper, error)

func NewUsingVariantPtr added in v0.5.6

func NewUsingVariantPtr(variant Variant) (*RwxWrapper, error)

func (*RwxWrapper) ApplyChmod added in v0.4.4

func (rwxWrapper *RwxWrapper) ApplyChmod(
	isSkipOnNonExist bool,
	fileOrDirectoryPath string,
) error

func (*RwxWrapper) ApplyLinuxChmodOnMany added in v0.5.5

func (rwxWrapper *RwxWrapper) ApplyLinuxChmodOnMany(
	condition *chmodins.Condition,
	locations ...string,
) error

func (*RwxWrapper) Bytes added in v0.4.4

func (rwxWrapper *RwxWrapper) Bytes() [3]byte

Bytes return rwx, (Owner)(Group)(Other) byte values under 1-7

func (*RwxWrapper) Clone added in v0.5.4

func (rwxWrapper *RwxWrapper) Clone() *RwxWrapper

func (*RwxWrapper) HasChmod added in v0.4.4

func (rwxWrapper *RwxWrapper) HasChmod(location string) bool

func (*RwxWrapper) LinuxApplyRecursive added in v0.4.5

func (rwxWrapper *RwxWrapper) LinuxApplyRecursive(
	isSkipOnNonExist bool,
	location string,
) error

LinuxApplyRecursive skip if it is a non dir path

func (*RwxWrapper) MustApplyChmod added in v0.4.4

func (rwxWrapper *RwxWrapper) MustApplyChmod(fileOrDirectoryPath string)

func (*RwxWrapper) String added in v0.4.4

func (rwxWrapper *RwxWrapper) String() string

func (*RwxWrapper) ToCompiledOctalBytes3Digits added in v0.4.4

func (rwxWrapper *RwxWrapper) ToCompiledOctalBytes3Digits() [3]byte

ToCompiledOctalBytes3Digits return '0'(Owner + '0')(Group + '0')(Other + '0') eg. 777, 555, 755 NOT rwx return

owner -> (0 - 7 value)
group -> (0 - 7 value)
other -> (0 - 7 value)

func (*RwxWrapper) ToCompiledOctalBytes4Digits added in v0.4.4

func (rwxWrapper *RwxWrapper) ToCompiledOctalBytes4Digits() [4]byte

ToCompiledOctalBytes4Digits return 0rwx, '0'(Owner + '0')(Group + '0')(Other + '0') eg. 0777, 0555, 0755 NOT 0rwx

func (*RwxWrapper) ToCompiledSplitValues added in v0.4.4

func (rwxWrapper *RwxWrapper) ToCompiledSplitValues() (owner, group, other byte)

ToCompiledSplitValues return

owner -> (0 - 7 value)
group -> (0 - 7 value)
other -> (0 - 7 value)
eg. 777, 755 etc

func (*RwxWrapper) ToFileMode added in v0.4.4

func (rwxWrapper *RwxWrapper) ToFileMode() os.FileMode

func (*RwxWrapper) ToFileModeString added in v0.4.4

func (rwxWrapper *RwxWrapper) ToFileModeString() string

ToFileModeString 4 digit string 0rwx, example 0777

func (*RwxWrapper) ToFullRwxValueString added in v0.4.4

func (rwxWrapper *RwxWrapper) ToFullRwxValueString() string

ToFullRwxValueString returns "-rwxrwxrwx"

func (*RwxWrapper) ToFullRwxValuesChars added in v0.4.4

func (rwxWrapper *RwxWrapper) ToFullRwxValuesChars() []byte

ToFullRwxValuesChars "-rwxrwxrwx" Bytes values

func (*RwxWrapper) ToRwxCompiledStr added in v0.4.4

func (rwxWrapper *RwxWrapper) ToRwxCompiledStr() string

ToRwxCompiledStr 3 digit string, example 777

func (*RwxWrapper) ToRwxInstruction added in v0.5.5

func (rwxWrapper *RwxWrapper) ToRwxInstruction(
	condition *chmodins.Condition,
) *chmodins.RwxInstruction

func (*RwxWrapper) ToRwxOwnerGroupOther added in v0.4.4

func (rwxWrapper *RwxWrapper) ToRwxOwnerGroupOther() *chmodins.RwxOwnerGroupOther

func (*RwxWrapper) ToUint32Octal added in v0.4.4

func (rwxWrapper *RwxWrapper) ToUint32Octal() uint32

func (*RwxWrapper) Verify added in v0.4.4

func (rwxWrapper *RwxWrapper) Verify(location string) error

func (*RwxWrapper) VerifyPaths added in v0.4.4

func (rwxWrapper *RwxWrapper) VerifyPaths(location *[]string, isContinueOnError bool) error

type SingleRwx added in v0.5.5

type SingleRwx struct {
	// Rwx Index Values
	//  - 0: 'r'/'*'/'-'
	//  - 1: 'w'/'*'/'-'
	//  - 2: 'x'/'*'/'-'
	// Examples can be :
	//  - "rwx" or
	//  - "*wx" or
	//  - "rw*" or
	//  - "***"
	//
	// Length must be 3. Not more not less.
	Rwx       string
	ClassType chmodclasstype.Variant
}

func NewSingleRwx added in v0.5.5

func NewSingleRwx(
	rwx string,
	classType chmodclasstype.Variant,
) (*SingleRwx, error)

func (*SingleRwx) ApplyOnMany added in v0.5.5

func (receiver *SingleRwx) ApplyOnMany(
	condition *chmodins.Condition,
	locations ...string,
) error

func (*SingleRwx) ToDisabledRwxWrapper added in v0.5.5

func (receiver *SingleRwx) ToDisabledRwxWrapper() (*RwxWrapper, error)

func (*SingleRwx) ToRwxInstruction added in v0.5.5

func (receiver *SingleRwx) ToRwxInstruction(
	conditionalIns *chmodins.Condition,
) *chmodins.RwxInstruction

func (*SingleRwx) ToRwxOwnerGroupOther added in v0.5.5

func (receiver *SingleRwx) ToRwxOwnerGroupOther() *chmodins.RwxOwnerGroupOther

func (*SingleRwx) ToRwxWrapper added in v0.5.5

func (receiver *SingleRwx) ToRwxWrapper() (*RwxWrapper, error)

func (*SingleRwx) ToVarRwxWrapper added in v0.5.5

func (receiver *SingleRwx) ToVarRwxWrapper() (*RwxVariableWrapper, error)

type VarAttribute added in v0.4.1

type VarAttribute struct {
	// contains filtered or unexported fields
}

func ParseRwxToVarAttribute added in v0.4.1

func ParseRwxToVarAttribute(rwx string) (varAttribute *VarAttribute, err error)

func (*VarAttribute) Clone added in v0.5.4

func (varAttribute *VarAttribute) Clone() *VarAttribute

func (*VarAttribute) IsFixedType added in v0.4.1

func (varAttribute *VarAttribute) IsFixedType() bool

func (*VarAttribute) ToCompileAttr added in v0.4.1

func (varAttribute *VarAttribute) ToCompileAttr(fixed *Attribute) Attribute

ToCompileAttr if fixed type then fixed param can be nil

func (*VarAttribute) ToCompileFixAttr added in v0.4.1

func (varAttribute *VarAttribute) ToCompileFixAttr() *Attribute

ToCompileFixAttr must check IsFixedType, before calling.

type Variant

type Variant string
const (
	AllRead                             Variant = "444"
	AllWrite                            Variant = "222"
	AllExecute                          Variant = "111"
	AllReadWrite                        Variant = "666"
	AllReadExecute                      Variant = "555"
	AllWriteExecute                     Variant = "333"
	OwnerAllReadWriteGroupOther         Variant = "755"
	ReadWriteOwnerReadGroupOther        Variant = "644"
	ReadWriteOwnerReadExecuteGroupOther Variant = "655"
	X111                                Variant = "111"
	X222                                Variant = "222"
	X333                                Variant = "333"
	X444                                Variant = "444"
	X555                                Variant = "555"
	X644                                Variant = "644"
	X655                                Variant = "655"
	X666                                Variant = "666"
	X677                                Variant = "677"
	X711                                Variant = "711"
	X722                                Variant = "722"
	X733                                Variant = "733"
	X744                                Variant = "744"
	X755                                Variant = "755"
	X766                                Variant = "766"
	X777                                Variant = "777"
)

func (*Variant) ExpandOctalByte added in v0.5.6

func (variant *Variant) ExpandOctalByte() (r7, w7, x7 byte)

func (*Variant) String

func (variant *Variant) String() string

func (*Variant) ToWrapper

func (variant *Variant) ToWrapper() (RwxWrapper, error)

func (*Variant) ToWrapperPtr added in v0.5.6

func (variant *Variant) ToWrapperPtr() (*RwxWrapper, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL