chmodins

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: MIT Imports: 4 Imported by: 9

Documentation

Index

Constants

View Source
const (
	RwxFullLength             = 10
	RwxWithoutHyphenLength    = 9
	RwxFullLengthString       = "10"
	AllWildCardsRwxFullString = "-*********"
)

Variables

This section is empty.

Functions

func FixRwxFullStringWithWildcards added in v0.5.6

func FixRwxFullStringWithWildcards(rwxFull string) (fixedRwx string)

FixRwxFullStringWithWildcards can be less than 10 and can be

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

func GetRwxFullLengthError added in v0.5.6

func GetRwxFullLengthError(rwxFull string) error

GetRwxFullLengthError must be 10 chars length

Types

type BaseRwxInstructions

type BaseRwxInstructions struct {
	RwxInstructions []RwxInstruction `json:"RwxInstructions,omitempty"`
}

func ParseBaseRwxInstructionsUsingJsonResult

func ParseBaseRwxInstructionsUsingJsonResult(
	result *corejson.Result,
) (*BaseRwxInstructions, error)

func ParseBaseRwxInstructionsUsingJsonResultMust

func ParseBaseRwxInstructionsUsingJsonResultMust(
	result *corejson.Result,
) *BaseRwxInstructions

func (*BaseRwxInstructions) Clone added in v0.5.4

func (BaseRwxInstructions) CloneNonPtr added in v0.8.0

func (it BaseRwxInstructions) CloneNonPtr() BaseRwxInstructions

func (*BaseRwxInstructions) HasAnyItem added in v0.5.4

func (it *BaseRwxInstructions) HasAnyItem() bool

func (*BaseRwxInstructions) IsEmpty added in v0.5.4

func (it *BaseRwxInstructions) IsEmpty() bool

func (*BaseRwxInstructions) Length added in v0.5.4

func (it *BaseRwxInstructions) Length() int

type Condition added in v0.5.5

type Condition struct {
	IsSkipOnInvalid   bool `json:"IsSkipOnInvalid"`
	IsContinueOnError bool `json:"IsContinueOnError"`
	IsRecursive       bool `json:"IsRecursive"`
}

func DefaultAllFalseCondition added in v0.5.5

func DefaultAllFalseCondition() *Condition

func DefaultAllFalseExceptRecurse added in v0.5.5

func DefaultAllFalseExceptRecurse() *Condition

DefaultAllFalseExceptRecurse only IsRecursive will be true

func DefaultAllTrueCondition added in v0.5.5

func DefaultAllTrueCondition() *Condition

func (*Condition) Clone added in v0.5.5

func (receiver *Condition) Clone() *Condition

func (Condition) CloneNonPtr added in v0.8.0

func (receiver Condition) CloneNonPtr() Condition

type RwxInstruction

type RwxInstruction struct {
	RwxOwnerGroupOther
	Condition
}

func ParseRwxInstructionUsingJsonResult

func ParseRwxInstructionUsingJsonResult(
	result *corejson.Result,
) (*RwxInstruction, error)

func ParseRwxInstructionUsingJsonResultMust

func ParseRwxInstructionUsingJsonResultMust(
	result *corejson.Result,
) *RwxInstruction

func (*RwxInstruction) Clone added in v0.5.4

func (receiver *RwxInstruction) Clone() *RwxInstruction

type RwxOwnerGroupOther

type RwxOwnerGroupOther struct {
	// String 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.
	Owner string `json:"Owner"`
	// String 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.
	Group string `json:"Group"`
	// String 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.
	Other string `json:"Other"`
}

RwxOwnerGroupOther

Owner, Group, Other: String 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.

func ExpandRwxFullStringToOwnerGroupOther added in v0.5.6

func ExpandRwxFullStringToOwnerGroupOther(rwxFullString string) (*RwxOwnerGroupOther, error)

func ExpandRwxFullStringToOwnerGroupOtherByFixingFirst added in v0.5.6

func ExpandRwxFullStringToOwnerGroupOtherByFixingFirst(
	rwxPartialRestWildcard string,
) (*RwxOwnerGroupOther, error)

ExpandRwxFullStringToOwnerGroupOtherByFixingFirst can be

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

func NewRwxOwnerGroupOther added in v0.5.6

func NewRwxOwnerGroupOther(
	ownerRwx,
	groupRwx,
	otherRwx string,
) *RwxOwnerGroupOther

NewRwxOwnerGroupOther

Each arg ownerRwx, groupRwx, otherRwx should have

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.

func (*RwxOwnerGroupOther) Clone added in v0.5.4

func (receiver *RwxOwnerGroupOther) Clone() *RwxOwnerGroupOther

func (*RwxOwnerGroupOther) ExpandCharGroup added in v0.5.4

func (receiver *RwxOwnerGroupOther) ExpandCharGroup() (r, w, x byte)

func (*RwxOwnerGroupOther) ExpandCharOther added in v0.5.4

func (receiver *RwxOwnerGroupOther) ExpandCharOther() (r, w, x byte)

func (*RwxOwnerGroupOther) ExpandCharOwner added in v0.5.4

func (receiver *RwxOwnerGroupOther) ExpandCharOwner() (r, w, x byte)

func (*RwxOwnerGroupOther) Is

func (receiver *RwxOwnerGroupOther) Is(
	ownerRwx,
	groupRwx,
	otherRwx string,
) bool

func (*RwxOwnerGroupOther) IsEqual

func (receiver *RwxOwnerGroupOther) IsEqual(another *RwxOwnerGroupOther) bool

func (*RwxOwnerGroupOther) IsGroup

func (receiver *RwxOwnerGroupOther) IsGroup(rwx string) bool

func (*RwxOwnerGroupOther) IsOther

func (receiver *RwxOwnerGroupOther) IsOther(rwx string) bool

func (*RwxOwnerGroupOther) IsOwner

func (receiver *RwxOwnerGroupOther) IsOwner(rwx string) bool

func (*RwxOwnerGroupOther) String

func (receiver *RwxOwnerGroupOther) String() string

String : Includes hyphen in-front constants.Hyphen +

receiver.Owner +
receiver.Group +
receiver.Other

func (*RwxOwnerGroupOther) ToString

func (receiver *RwxOwnerGroupOther) ToString(isIncludeHyphen bool) string

Jump to

Keyboard shortcuts

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