pathchmod

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyChmod added in v0.1.2

func ApplyChmod(
	isRecursive bool,
	isSkipOnInvalid bool,
	changeFileMode os.FileMode,
	location string,
) (*chmodhelper.RwxWrapper, *errorwrapper.Wrapper)

func ApplyChmodOnFiles added in v0.1.2

func ApplyChmodOnFiles(
	isRecursive,
	isSkipOnInvalid,
	isContinueOnError bool,
	changeFileMode os.FileMode,
	locations ...string,
) (*chmodins.RwxInstruction, *errorwrapper.Wrapper)

func ApplyChmodOnFilesUsingCondition added in v0.1.2

func ApplyChmodOnFilesUsingCondition(
	condition *chmodins.Condition,
	changeFileMode os.FileMode,
	locations ...string,
) (*chmodins.RwxInstruction, *errorwrapper.Wrapper)

func ApplyChmodRwxInstructions added in v0.1.2

func ApplyChmodRwxInstructions(
	instructions *chmodins.BaseRwxInstructions,
	paths []string,
) *errorwrapper.Wrapper

func ApplyChmodRwxOwnerGroupOther added in v0.1.5

func ApplyChmodRwxOwnerGroupOther(
	isRecursive,
	isSkipOnInvalid,
	isContinueOnError bool,
	rwxOwnerGroupOther *chmodins.RwxOwnerGroupOther,
	paths []string,
) *errorwrapper.Wrapper

func ApplyLinuxRecursiveChmodOnPathUsingFileMode added in v0.1.5

func ApplyLinuxRecursiveChmodOnPathUsingFileMode(
	mode os.FileMode,
	rootDir string,
) *errorwrapper.Wrapper

func ChangeOwnership

func ChangeOwnership(location, user, group string) *errorwrapper.Wrapper

func ChangeOwnershipLocations added in v0.2.1

func ChangeOwnershipLocations(
	isContinueOnError,
	isRecursive bool,
	user, group string,
	errorCollection *errwrappers.Collection,
	locations []string,
) *errorwrapper.Wrapper

ChangeOwnershipLocations not implemented

TODO : https://gitlab.com/evatix-go/pathhelper/-/issues/56

func ChangeOwnershipOptions added in v0.2.1

func ChangeOwnershipOptions(
	isRecursive bool,
	location, user, group string,
) *errorwrapper.Wrapper

func ChangeOwnershipRecursive added in v0.2.1

func ChangeOwnershipRecursive(location, user, group string) *errorwrapper.Wrapper

func ChangeOwnershipWindows added in v0.2.1

func ChangeOwnershipWindows(location, user, group string) *errorwrapper.Wrapper

ChangeOwnershipWindows non recursive

func ChangeOwnershipWindowsUsingIds added in v0.2.1

func ChangeOwnershipWindowsUsingIds(
	location string,
	userId, groupId int,
) *errorwrapper.Wrapper

ChangeOwnershipWindowsUsingIds non recursive

func ChmodApply added in v0.1.2

func ChmodApply(
	isRecursive bool,
	isSkipOnError bool,
	wrapper *chmodhelper.RwxWrapper,
	paths ...string,
) *errorwrapper.Wrapper

ChmodApply Format : chmod -R 777 /var/lib/powerdns

func ChmodChangeExecuteRevert added in v0.1.2

func ChmodChangeExecuteRevert(
	isRecursive,
	isSkipOnInvalid bool,
	changeFileMode os.FileMode,
	location string,
	executor func(location string) *errorwrapper.Wrapper,
) *errorwrapper.Wrapper

func ChmodChangeExecuteRevertUsingRwxWrapper added in v0.1.2

func ChmodChangeExecuteRevertUsingRwxWrapper(
	isRecursive,
	isSkipOnInvalid bool,
	changeFileModeRwxWrapper *chmodhelper.RwxWrapper,
	location string,
	executor func(location string) *errorwrapper.Wrapper,
) *errorwrapper.Wrapper

func ExistingChmodRwxWrapper added in v0.1.2

func ExistingChmodRwxWrapper(
	location string,
) (*chmodhelper.RwxWrapper, *errorwrapper.Wrapper)

func FullRwxToFileMode added in v0.1.5

func FullRwxToFileMode(rwxFull string) (os.FileMode, *errorwrapper.Wrapper)

func FullRwxToRwxWrapper added in v0.1.5

func FullRwxToRwxWrapper(rwxFull string) (*chmodhelper.RwxWrapper, *errorwrapper.Wrapper)

func GetLocationsRwxWrappers added in v0.1.3

func GetLocationsRwxWrappers(
	isContinueOnError bool,
	locations []string,
) (
	filePathToRwxWrapper *map[string]*chmodhelper.RwxWrapper,
	errWp *errorwrapper.Wrapper,
)

func GetUserGroupId added in v0.2.1

func GetUserGroupId(userName string, groupName string) (
	userId int,
	groupId int,
	errWrapper *errorwrapper.Wrapper,
)

func ParseRwxOwnerGroupOtherToFileMode added in v0.1.5

func ParseRwxOwnerGroupOtherToFileMode(
	rwxOwnerGroupOther *chmodins.RwxOwnerGroupOther,
) (os.FileMode, *errorwrapper.Wrapper)

func ParseRwxOwnerGroupOtherToRwxWrapper added in v0.1.5

func ParseRwxOwnerGroupOtherToRwxWrapper(
	rwxOwnerGroupOther *chmodins.RwxOwnerGroupOther,
) (*chmodhelper.RwxWrapper, *errorwrapper.Wrapper)

func VerifyRwxErrorLocations added in v0.1.3

func VerifyRwxErrorLocations(
	isRecursiveErrorIgnore bool,
	instruction *chmodins.RwxInstruction,
	locations []string,
) *errorwrapper.Wrapper

Types

type ChmodWithError added in v0.2.2

type ChmodWithError struct {
	Chmod os.FileMode
	errinf.ErrWrapper
}

func ExistingChmodWithError added in v0.2.2

func ExistingChmodWithError(location string) *ChmodWithError

type RwxWrapperWithError added in v0.2.2

type RwxWrapperWithError struct {
	RwxWrapper *chmodhelper.RwxWrapper
	errinf.ErrWrapper
}

func ExistingRwxWrapperWithError added in v0.2.2

func ExistingRwxWrapperWithError(location string) *RwxWrapperWithError

type SimpleStat added in v0.2.2

type SimpleStat struct {
	Location   string
	FileInfo   os.FileInfo
	IsNotExist bool
	IsExist    bool
	IsDir      bool
	IsFile     bool
	errinf.ErrWrapper
}

func GetSimpleStat added in v0.2.2

func GetSimpleStat(
	location string,
) *SimpleStat

func (*SimpleStat) CheckSum added in v0.2.2

func (it *SimpleStat) CheckSum(hashType hashas.Variant) *errstr.Result

func (*SimpleStat) GetChmodWithError added in v0.2.2

func (it *SimpleStat) GetChmodWithError() *ChmodWithError

func (*SimpleStat) GetRwxWithError added in v0.2.2

func (it *SimpleStat) GetRwxWithError() *RwxWrapperWithError

func (*SimpleStat) ReadBytes added in v0.2.2

func (it *SimpleStat) ReadBytes() *errbyte.Results

func (*SimpleStat) ReadString added in v0.2.2

func (it *SimpleStat) ReadString() *errstr.Result

type SimpleStatMap added in v0.2.2

type SimpleStatMap struct {
	Items map[string]*SimpleStat
}

func GetSimpleStats added in v0.2.2

func GetSimpleStats(
	locations []string,
) *SimpleStatMap

func NewSimpleStatMap added in v0.2.2

func NewSimpleStatMap(capacity int) *SimpleStatMap

func (*SimpleStatMap) Add added in v0.2.2

func (it *SimpleStatMap) Add(loc string) *SimpleStatMap

func (*SimpleStatMap) Adds added in v0.2.2

func (it *SimpleStatMap) Adds(locations ...string) *SimpleStatMap

func (*SimpleStatMap) AsBasicMapper added in v0.2.2

func (it *SimpleStatMap) AsBasicMapper() coreinterface.BasicMapper

func (*SimpleStatMap) Count added in v0.2.2

func (it *SimpleStatMap) Count() int

func (*SimpleStatMap) HasAnyItem added in v0.2.2

func (it *SimpleStatMap) HasAnyItem() bool

func (*SimpleStatMap) HasIndex added in v0.2.2

func (it *SimpleStatMap) HasIndex(index int) bool

func (*SimpleStatMap) HasLocation added in v0.2.2

func (it *SimpleStatMap) HasLocation(loc string) bool

func (*SimpleStatMap) IsEmpty added in v0.2.2

func (it *SimpleStatMap) IsEmpty() bool

func (*SimpleStatMap) LastIndex added in v0.2.2

func (it *SimpleStatMap) LastIndex() int

func (*SimpleStatMap) Length added in v0.2.2

func (it *SimpleStatMap) Length() int

func (*SimpleStatMap) Locations added in v0.2.2

func (it *SimpleStatMap) Locations() []string

func (*SimpleStatMap) SimpleStats added in v0.2.2

func (it *SimpleStatMap) SimpleStats() []*SimpleStat

func (*SimpleStatMap) String added in v0.2.2

func (it *SimpleStatMap) String() string

Jump to

Keyboard shortcuts

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