Documentation ¶
Overview ¶
mimixbox/internal/lib/common.go
Copyright 2021 Naohiro CHIKAMATSU ¶
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
Copyright 2021 Naohiro CHIKAMATSU ¶
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
Copyright 2021 Naohiro CHIKAMATSU ¶
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
Copyright 2021 Naohiro CHIKAMATSU ¶
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
Copyright 2021 Naohiro CHIKAMATSU ¶
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
Copyright 2021 Naohiro CHIKAMATSU ¶
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
Copyright 2021 Naohiro CHIKAMATSU ¶
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
Copyright 2021 Naohiro CHIKAMATSU ¶
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
Copyright 2021 Naohiro CHIKAMATSU ¶
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
Copyright 2021 Naohiro CHIKAMATSU ¶
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
- func AddLineFeed(lines []string) []string
- func BaseNameWithoutExt(path string) string
- func ChecksumOutput(hash hash.Hash, r io.Reader, path string) error
- func Chop(line string) string
- func ChopAll(lines []string) []string
- func CompareChecksum(h hash.Hash, paths []string) error
- func Concatenate(path []string, lfAtTheJoint bool) ([]string, error)
- func Contains(list interface{}, elem interface{}) bool
- func Copy(src string, dest string) error
- func Dump(lines []string, withNumber bool)
- func DumpGroups(groups []user.Group, showName bool)
- func ExistCmd(cmd string) bool
- func Exists(path string) bool
- func FromPIPE() (string, error)
- func Groups(uname string) ([]user.Group, error)
- func HasHelpOpt(args []string) bool
- func HasPipeData() bool
- func HasVersionOpt(args []string) bool
- func Input() (string, bool)
- func Ip4() ([]string, error)
- func IsDir(path string) bool
- func IsExecutable(path string) bool
- func IsFile(path string) bool
- func IsHiddenFile(filePath string) bool
- func IsReadable(path string) bool
- func IsRootDir(path string) bool
- func IsRootUser() bool
- func IsSameFileName(src string, dest string) bool
- func IsSamePath(src string, dest string) bool
- func IsSymlink(path string) bool
- func IsWritable(path string) bool
- func IsZero(path string) bool
- func ListDigit(strList []string) string
- func ListToFile(filepath string, lines []string) error
- func Parrot(withNl bool)
- func PrintStrListWithNumberLine(strList []string, countEmpryLine bool)
- func PrintStrWithNumberLine(nl int, format string, message string)
- func Question(ask string) bool
- func ReadFileToStrList(path string) ([]string, error)
- func Remove(strings []string, target string) []string
- func RemoveDir(dir string, interactive bool) error
- func RemoveFile(path string, interactive bool) error
- func ReplaceAll(lines []string, target string, after string) []string
- func ShowVersion(cmdName string, version string)
- func SimpleBackupSuffix() string
- func TopDirName(path string) string
- func Walk(dir string) ([]string, []string, error)
- func WrapString(src string, column int) string
Constants ¶
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 BaseNameWithoutExt ¶
BaseNameWithoutExt return file name without extension.
func ChecksumOutput ¶ added in v0.25.1
func CompareChecksum ¶ added in v0.25.1
e.g. hash is md5.New(), md5.New(), sha512.New(), etc...
func DumpGroups ¶ added in v0.22.0
func HasHelpOpt ¶
func HasPipeData ¶
func HasPipeData() bool
func HasVersionOpt ¶
func IsExecutable ¶
IsExecutable reports whether the path exists and is executable.
func IsHiddenFile ¶
IsHiddenFile reports whether the path exists and is included hidden file.
func IsReadable ¶
IsReadable reports whether the path exists and is readable.
func IsRootUser ¶
func IsRootUser() bool
func IsSameFileName ¶
IsSameFileName return true if src and dest is same name, false if src and dest is not same name
func IsSamePath ¶
IsSamePath return true if src and dest is same path, false if src and dest is not same path or error occur
func IsWritable ¶
IsWritable reports whether the path exists and is writable.
func ListToFile ¶ added in v0.22.0
func PrintStrWithNumberLine ¶
func ReadFileToStrList ¶
func RemoveFile ¶ added in v0.22.0
func ReplaceAll ¶ added in v0.22.0
func ShowVersion ¶ added in v0.22.0
func SimpleBackupSuffix ¶
func SimpleBackupSuffix() string
func TopDirName ¶
TopDirName return top directory name from path.
func WrapString ¶
Types ¶
This section is empty.