mb

package
v0.27.18 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

mimixbox/internal/lib/common.go

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

mimixbox/internal/lib/crypto.go

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

mimixbox/internal/lib/file.go

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

mimixbox/internal/lib/gnu.go

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

mimixbox/internal/lib/net.go

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

mimixbox/internal/lib/option.go

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

mimixbox/internal/lib/path.go

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

mimixbox/internal/lib/shell.go

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

mimixbox/internal/lib/string.go

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

mimixbox/internal/lib/type.go

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// Unknown : Don't use this bits
	Unknown os.FileMode = 1 << (9 - iota)
	// Readable : readable bits
	Readable
	// Writable : writable bits
	Writable
	// Executable : executable bits
	Executable
)

Variables

This section is empty.

Functions

func AddLineFeed

func AddLineFeed(lines []string) []string

func BaseNameWithoutExt

func BaseNameWithoutExt(path string) string

BaseNameWithoutExt return file name without extension.

func ChecksumOutput added in v0.25.1

func ChecksumOutput(hash hash.Hash, r io.Reader, path string) error

func Chop

func Chop(line string) string

func ChopAll

func ChopAll(lines []string) []string

func CompareChecksum added in v0.25.1

func CompareChecksum(h hash.Hash, paths []string) error

e.g. hash is md5.New(), md5.New(), sha512.New(), etc...

func Concatenate

func Concatenate(path []string, lfAtTheJoint bool) ([]string, error)

func Contains

func Contains(list interface{}, elem interface{}) bool

func Copy

func Copy(src string, dest string) error

Copy file(src) to dest

func Dump added in v0.22.0

func Dump(lines []string, withNumber bool)

func DumpGroups added in v0.22.0

func DumpGroups(groups []user.Group, showName bool)

func ExistCmd

func ExistCmd(cmd string) bool

func Exists

func Exists(path string) bool

Exists reports whether the path exists.

func FromPIPE

func FromPIPE() (string, error)

func Groups added in v0.22.0

func Groups(uname string) ([]user.Group, error)

func HasHelpOpt

func HasHelpOpt(args []string) bool

func HasPipeData

func HasPipeData() bool

func HasVersionOpt

func HasVersionOpt(args []string) bool

func Input

func Input() (string, bool)

func Ip4 added in v0.25.1

func Ip4() ([]string, error)

func IsDir

func IsDir(path string) bool

IsDir reports whether the path exists and is a directory.

func IsExecutable

func IsExecutable(path string) bool

IsExecutable reports whether the path exists and is executable.

func IsFile

func IsFile(path string) bool

IsFile reports whether the path exists and is a file.

func IsHiddenFile

func IsHiddenFile(filePath string) bool

IsHiddenFile reports whether the path exists and is included hidden file.

func IsReadable

func IsReadable(path string) bool

IsReadable reports whether the path exists and is readable.

func IsRootDir

func IsRootDir(path string) bool

func IsRootUser

func IsRootUser() bool

func IsSameFileName

func IsSameFileName(src string, dest string) bool

IsSameFileName return true if src and dest is same name, false if src and dest is not same name

func IsSamePath

func IsSamePath(src string, dest string) bool

IsSamePath return true if src and dest is same path, false if src and dest is not same path or error occur

func IsSymlink(path string) bool

IsSymlink reports whether the path exists and is a symbolic link.

func IsWritable

func IsWritable(path string) bool

IsWritable reports whether the path exists and is writable.

func IsZero

func IsZero(path string) bool

IsZero reports whether the path exists and is zero size.

func ListDigit added in v0.27.16

func ListDigit(strList []string) string

func ListToFile added in v0.22.0

func ListToFile(filepath string, lines []string) error

func Parrot

func Parrot(withNl bool)

func PrintStrListWithNumberLine

func PrintStrListWithNumberLine(strList []string, countEmpryLine bool)

func PrintStrWithNumberLine

func PrintStrWithNumberLine(nl int, format string, message string)

func Question

func Question(ask string) bool

func ReadFileToStrList

func ReadFileToStrList(path string) ([]string, error)

func Remove added in v0.27.1

func Remove(strings []string, target string) []string

func RemoveDir added in v0.22.0

func RemoveDir(dir string, interactive bool) error

func RemoveFile added in v0.22.0

func RemoveFile(path string, interactive bool) error

func ReplaceAll added in v0.22.0

func ReplaceAll(lines []string, target string, after string) []string

func ShowVersion added in v0.22.0

func ShowVersion(cmdName string, version string)

func SimpleBackupSuffix

func SimpleBackupSuffix() string

func TopDirName

func TopDirName(path string) string

TopDirName return top directory name from path.

func Walk

func Walk(dir string) ([]string, []string, error)

Wark return 1)directory List, 2) file list, 3) error

func WrapString

func WrapString(src string, column int) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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