Documentation
¶
Overview ¶
Copyright (c) 2025 Chakib Ben Ziane <contact@blob42.xyz> and [`gosuki` contributors](https://github.com/blob42/gosuki/graphs/contributors). All rights reserved.
SPDX-License-Identifier: AGPL-3.0-or-later
This file is part of GoSuki.
GoSuki is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
GoSuki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with gosuki. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Variables
- func CamelCase(in string) string
- func CheckFileExists(file string) (bool, error)
- func CleanFiles()
- func CopyFileToDst(src string, dst string) error
- func CopyFilesToTmpFolder(srcglob string, dst string) error
- func CountLines(f *os.File) (int, error)
- func DecodeUnicodeEscapes(s string) string
- func DirExists(path string) (bool, error)
- func ExpandOnly(paths ...string) (string, error)
- func ExpandPath(paths ...string) (string, error)
- func Extends[T comparable](list []T, in ...T) []T
- func FileProcessUsers(path string) (map[int32]*psutil.Process, error)
- func GenStringID(n int) string
- func GetDataDir() (string, error)
- func InList[T comparable](list []T, elm T) bool
- func IsSymlink(path string) (bool, error)
- func Map[T, U comparable](f func(item T) U, list []T) []U
- func MkDir(dir string) error
- func MkGosukiDataDir() error
- func MustExpandPath(paths ...string) string
- func ReplaceInList(src []string, old string, new string) []string
- func Shorten(path string) string
- func UseVar(any any)
Constants ¶
This section is empty.
Variables ¶
var (
TMPDIR = ""
)
Functions ¶
func CheckFileExists ¶
func CopyFileToDst ¶ added in v1.1.0
func CopyFilesToTmpFolder ¶
Copy files from src glob to dst folder
func DecodeUnicodeEscapes ¶
func ExpandOnly ¶
ExpandOnly expands a path without following symlinks
func ExpandPath ¶
ExpandPath expands a path with environment variables and tilde Symlinks are followed by default
func Extends ¶
func Extends[T comparable](list []T, in ...T) []T
Extends a slice of T with element `in`, like a Set
func GenStringID ¶
Generate a unique random string with the specified length
func GetDataDir ¶
func Map ¶
func Map[T, U comparable](f func(item T) U, list []T) []U
map takes a list and a function and returns a new list
func MkDir ¶
MkDir checks if a directory is writable by the current user. It returns an error if the directory does not exist and cannot be created, or if it exists but is not writable by the current user. Otherwise it is created.
func MkGosukiDataDir ¶
func MkGosukiDataDir() error
func MustExpandPath ¶
func ReplaceInList ¶
function that iterates through the list of string, for each element it replaces the occurence of old with new, and returns the updated list
Types ¶
This section is empty.