pathchmod

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: MIT Imports: 27 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
	Name            string // name with extension
	HasFileInfo     bool
	InvalidFileInfo bool
	IsNotExist      bool
	IsExist         bool
	IsDir           bool
	IsFile          bool
	ErrorWrapper    *errorwrapper.Wrapper
}

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) *errbyte.Results

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) HasError added in v0.4.2

func (it *SimpleStat) HasError() bool

func (*SimpleStat) HexCheckSumString added in v0.4.2

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

func (*SimpleStat) IsEmptyError added in v0.4.2

func (it *SimpleStat) IsEmptyError() bool

func (*SimpleStat) LastModifiedDate added in v0.4.2

func (it *SimpleStat) LastModifiedDate() *time.Time

func (*SimpleStat) ReadBytes added in v0.2.2

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

func (*SimpleStat) ReadBytesMust added in v0.3.6

func (it *SimpleStat) ReadBytesMust() []byte

func (*SimpleStat) ReadString added in v0.2.2

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

func (*SimpleStat) ReadStringMust added in v0.3.6

func (it *SimpleStat) ReadStringMust() string

func (*SimpleStat) Size added in v0.4.2

func (it *SimpleStat) Size() *int64

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) Names added in v0.3.6

func (it *SimpleStatMap) Names() []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

type SimpleStats added in v0.3.6

type SimpleStats struct {
	Items []*SimpleStat
}

func NewSimpleStats added in v0.3.6

func NewSimpleStats(capacity int) *SimpleStats

func NewSimpleStatsUsingItems added in v0.3.6

func NewSimpleStatsUsingItems(locations ...string) *SimpleStats

func (*SimpleStats) Add added in v0.3.6

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

func (*SimpleStats) Adds added in v0.3.6

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

func (*SimpleStats) AsBasicMapper added in v0.3.6

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

func (*SimpleStats) Count added in v0.3.6

func (it *SimpleStats) Count() int

func (*SimpleStats) HasAnyItem added in v0.3.6

func (it *SimpleStats) HasAnyItem() bool

func (*SimpleStats) HasIndex added in v0.3.6

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

func (*SimpleStats) HasLocation added in v0.3.6

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

func (*SimpleStats) IsEmpty added in v0.3.6

func (it *SimpleStats) IsEmpty() bool

func (*SimpleStats) LastIndex added in v0.3.6

func (it *SimpleStats) LastIndex() int

func (*SimpleStats) Length added in v0.3.6

func (it *SimpleStats) Length() int

func (*SimpleStats) Locations added in v0.3.6

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

func (*SimpleStats) Names added in v0.3.6

func (it *SimpleStats) Names() []string

func (*SimpleStats) SimpleStats added in v0.3.6

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

func (*SimpleStats) String added in v0.3.6

func (it *SimpleStats) String() string

Jump to

Keyboard shortcuts

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