library

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const HelpText = `` /* 170-byte string literal not displayed */

Documentation Help

Variables

This section is empty.

Functions

func CountFilesContainingText added in v1.7.0

func CountFilesContainingText(path string, text string, exclude []string) int

* Count Files Containing Text

func DeleteDirectoriesorFilesinPath added in v1.4.0

func DeleteDirectoriesorFilesinPath(root string, dirnames []string, filenames []string) error

* Delete Directory or Files in Path Matching Filename

func DirectoryStats added in v1.6.0

func DirectoryStats(path string, print bool) (int, int64, int64, map[string]int, int, int)

* Directory Stats

func ExecCommand

func ExecCommand(args ...string) string

Run custom bin command

func ExtractURLsFromDirectoryPath added in v1.9.0

func ExtractURLsFromDirectoryPath(path string, baseURL string) ([]string, error)

* Exctract URLs from Directory Path

func ExtractYouTubeData added in v1.9.0

func ExtractYouTubeData(inputFilePath string)

* Extract YouTube Data

func FileExistsInPath added in v1.10.0

func FileExistsInPath(filePath, directoryPath string) (bool, error)

File Exist in Path.

func GetDepth added in v1.10.0

func GetDepth(path string, dirPath string) int

Create a helper function to determine the depth of a directory.

func GetResponsefromChatGPT added in v1.4.0

func GetResponsefromChatGPT(client gpt3.Client, ctx context.Context, question string)

Get Response from ChatGPT

func GetShellRemoveFunction

func GetShellRemoveFunction(path string) string

Get Shell Remove Function

func GitGone added in v1.7.0

func GitGone()

Git Gone Implementation in Go

func InitiateChatGPTFunction added in v1.4.0

func InitiateChatGPTFunction(flags Flag)

Initiate ChatGPT Function

func InitiateDirectoryFunction added in v1.10.0

func InitiateDirectoryFunction(flags Flag)

Initiate Directory Function

func InitiateDockerFunction

func InitiateDockerFunction(flags Flag)

Initiate Docker Function

func InitiateFileFunction added in v1.9.0

func InitiateFileFunction(flags Flag)

Initiate File Function

func InitiateGitFunction

func InitiateGitFunction(flags Flag)

Initiate Git Function

func InitiateHelpFunction added in v1.7.0

func InitiateHelpFunction(flags Flag)

Help Flag

func InitiateMarkdownFunction added in v1.3.0

func InitiateMarkdownFunction(flags Flag)

Initiate Markdown Function

func InitiateMiscellaneousFunction

func InitiateMiscellaneousFunction(flags Flag)

* Initiate Miscellaneous Function

func InitiateNoIPFunction added in v1.5.0

func InitiateNoIPFunction(flags Flag)

* Initiate NoIP Function

func InitiatePHPCSFunction added in v1.7.0

func InitiatePHPCSFunction(flags Flag)

* Initiate PHPCS Function

func InitiatePHPFunction added in v1.4.0

func InitiatePHPFunction(flags Flag)

* Initiate PHP Function

func InitiateQuoteFunction

func InitiateQuoteFunction(flags Flag)

* Initiate Quote Function

func InitiateRsyncFunction added in v1.10.0

func InitiateRsyncFunction(flags Flag)

Initiate File Function

func InitiateSyncthingFunction added in v1.6.0

func InitiateSyncthingFunction(flags Flag)

* Initiate Syncthing Function

func InitiateYouTubeFunction added in v1.9.0

func InitiateYouTubeFunction(flags Flag)

* Initiate Syncthing Function

func MarkdownGenerateFileTree added in v1.8.0

func MarkdownGenerateFileTree(path string, ignore []string) string

Generate File Tree from Directory

func MarkdownRemoveLink(markdown string) string

Remove Link from Markdown File

func QuoteofTheDay

func QuoteofTheDay()

* Show Quote of The Day

func ReadFile

func ReadFile(path string) []byte

Read File

func RemoveDirectoriesOlderThan added in v1.10.0

func RemoveDirectoriesOlderThan(path string, retentionDays int, level int, exclude []string, dryrun bool) error

Remove directory older than.

func RemoveFilesExceptExtensions added in v1.4.0

func RemoveFilesExceptExtensions(root string, allowedExtensions []string, exception []string) error

* Remove Files Except Specified Extensions

func RemoveFilesOlderThan added in v1.6.0

func RemoveFilesOlderThan(path string, pattern string, retentionDays int, exclude []string, dryrun bool) error

* Remove Files Older Than

func RenameFile added in v1.7.1

func RenameFile(oldPath string, newPath string)

Rename File

func Rsync added in v1.10.0

func Rsync()

Rsync command

func SearchandReplace

func SearchandReplace(path string, from string, to string, limit int)

* Search and Replace in Directory or File

func SliceContainsString

func SliceContainsString(elems []string, v string) bool

Slice Contains String

func Slugify added in v1.8.0

func Slugify(s string) string

* Slugify function

func UpdateNoIPHostName added in v1.5.0

func UpdateNoIPHostName(username string, password string, hostname string)

* Update Hostname IP

func WriteFile

func WriteFile(FilePath string, content string)

Write File

Types

type Flag

type Flag struct {
	// Mode
	ChatGPT            *bool
	Dir                *bool
	Docker             *bool
	DockerCompose      *bool
	DryRun             *bool
	Extract            *bool
	ExtractUrl         *bool
	File               *bool
	Git                *bool
	Gone               *bool
	Help               *bool
	Install            *bool
	ListClass          *bool
	ListFunction       *bool
	ListFunctionCall   *bool
	Minify             *bool
	Markdown           *bool
	NoIP               *bool
	OlderThan          *bool
	PHP                *bool
	PHPCS              *bool
	QuoteofTheDay      *bool
	Remove             *bool
	RemoveConflicts    *bool
	RemoveLink         *bool
	RemoveFunction     *bool
	ResetCache         *bool
	Rsync              *bool
	Stats              *bool
	SearchandReplace   *bool
	Syncthing          *bool
	WPClean            *bool
	WPPluginBuild      *bool
	WPPluginBuildCheck *bool
	WPPluginRelease    *bool
	WPThemeBuild       *bool
	WPThemeBuildCheck  *bool
	WPRefactor         *bool
	SelfUpdate         *bool
	Tree               *bool
	Update             *bool
	YouTube            *bool

	// Bool Parameters
	Count      *bool
	Production *bool
	Prune      *bool
	Reset      *bool
	Restart    *bool
	Version    *bool

	// String Parameters
	API_KEY      *string
	ID           *string
	Days         *int
	Dirname      *[]string
	Ext          *[]string
	Except       *[]string
	Exclude      *[]string
	Filename     *[]string
	FunctionName *[]string
	From         *string
	Hostname     *string
	Level        *int
	Limit        *int
	Message      *string
	Path         *string
	Password     *string
	Regex        *string
	Text         *string
	To           *string
	Type         *string
	Url          *string
	Username     *string
}

Flag Structure

func GetFlag

func GetFlag() Flag

Get Flag

type FunctionObject added in v1.6.0

type FunctionObject struct {
	Path         string
	FunctionCall string
}

FunctionObject struct to store path and function call

type NullWriter added in v1.4.0

type NullWriter int

func (NullWriter) Write added in v1.4.0

func (NullWriter) Write([]byte) (int, error)

type PHPCSConfig added in v1.10.0

type PHPCSConfig struct {
	Phpcs string `json:"phpcs"`
}

PHPCS Config

type PHPClass added in v1.4.0

type PHPClass struct {
	Name string
	Path string
}

* PHP Class

func ListPHPClasses added in v1.4.0

func ListPHPClasses(root string) ([]PHPClass, error)

* Function to List PHP Classes inside Directory and Subdirectory

type PHPFunction added in v1.4.0

type PHPFunction struct {
	Name string
	Path string
}

* PHP Function

func ListPHPFunctions added in v1.4.0

func ListPHPFunctions(root string) ([]PHPFunction, error)

* List PHP Functions

type RsyncConfig added in v1.10.0

type RsyncConfig struct {
	Flags       string         `json:"flags"`
	Source      RsyncDirectory `json:"source"`
	Destination RsyncDirectory `json:"destination"`
	Excludes    []string       `json:"excludes"`
}

type RsyncDirectory added in v1.10.0

type RsyncDirectory struct {
	Remote string `json:"remote"`
	Path   string `json:"path"`
}

Jump to

Keyboard shortcuts

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