Documentation
¶
Index ¶
- func CheckOrCreateDir(path string) error
- func Clone(path string, repoName string, version string) error
- func CreateNewPpmConfig(path string) error
- func DoesPathExist(path string) (bool, error)
- func GetFirstMatch[t any](slice []t, predicate func(t, int) bool) *t
- func GetPathsAndConfig() (Paths, PpmConfig, error)
- func GetPluginName(name string) string
- func GetVersionOrNot(dependency string) (string, string)
- func IndexOf[t comparable](target t, data []t) int
- func PrintDone()
- func SliceContains[t comparable](target t, data []t) bool
- func SliceToString(slice []string, seperator string) string
- func Update(path string) error
- type LoadingVisualization
- type Paths
- type PpmConfig
- func (ppm *PpmConfig) AddDependency(dependency string)
- func (ppm *PpmConfig) AddSubDependency(dependency string)
- func (ppm PpmConfig) HasDependency(dependency string) bool
- func (ppm PpmConfig) HasSubDependency(dependency string) bool
- func (ppm PpmConfig) PrettyPrint()
- func (ppm *PpmConfig) RemoveAllDependencies()
- func (ppm *PpmConfig) RemoveDependency(dependency string)
- func (ppm *PpmConfig) RemoveSubDependency(dependency string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckOrCreateDir ¶
Create a certain directory if it doesn't exist
func DoesPathExist ¶
Check wether an absolute path exists
func GetFirstMatch ¶ added in v1.1.2
Get the first predicate match of the slice
returns nil if none of the items match
func GetPathsAndConfig ¶ added in v1.1.2
func GetPluginName ¶
func GetVersionOrNot ¶
func IndexOf ¶
func IndexOf[t comparable](target t, data []t) int
Get the index of a certain item in a string slice
func SliceContains ¶ added in v1.1.2
func SliceContains[t comparable](target t, data []t) bool
Check wether a certain item exists in a string slice
func SliceToString ¶ added in v1.1.2
Types ¶
type LoadingVisualization ¶ added in v1.1.2
type LoadingVisualization struct {
Active bool
AnimationFrames []string
// contains filtered or unexported fields
}
func StartLoading ¶ added in v1.1.2
func StartLoading() *LoadingVisualization
Create and start a new LoadingVisualziation instance
func (*LoadingVisualization) Run ¶ added in v1.1.2
func (l *LoadingVisualization) Run(speed time.Duration)
Run the loading animation
func (*LoadingVisualization) Start ¶ added in v1.1.2
func (l *LoadingVisualization) Start()
Prepare and run the loading animation in a new goroutine
func (*LoadingVisualization) Stop ¶ added in v1.1.2
func (l *LoadingVisualization) Stop()
Stop the loading animation
type Paths ¶
type Paths struct {
/*
The root of the project.
If the project is a game, the root is on the same level
as the godot config files.
If the project is a plugin, the root is somewhere under /addons
*/
Root string
// The path to the addons folder
Addons string
// The path to the ppm.json config file
ConfigFile string
}
Access different important paths in the GD project
func CreatePaths ¶
Create a new paths instance from the root path
func CreatePathsFromCwd ¶
Create a new paths instance from the current working directory
type PpmConfig ¶
type PpmConfig struct {
IsPlugin bool `json:"plugin"`
Dependencies []string `json:"dependencies"`
SubDependencies []string `json:"sub-dependencies"`
// contains filtered or unexported fields
}
Representing a ppm.json configuration file
func ParsePpmConfig ¶
Parse the ppm.json file to an object
func (*PpmConfig) AddDependency ¶
Add an item safely to the Dependencies property
func (*PpmConfig) AddSubDependency ¶
Add an item safely to the sub-dependencies property
func (PpmConfig) HasDependency ¶
Check wether the config file has a certain dependency
func (PpmConfig) HasSubDependency ¶
Check wether the config file has a certain sub-dependency
func (PpmConfig) PrettyPrint ¶
func (ppm PpmConfig) PrettyPrint()
func (*PpmConfig) RemoveAllDependencies ¶
func (ppm *PpmConfig) RemoveAllDependencies()
Remove ALL (sub)dependencies
func (*PpmConfig) RemoveDependency ¶
Remove an item safely from the sub-dependencies property by its name
func (*PpmConfig) RemoveSubDependency ¶
Remove an item safely from the Dependencies property by its name