Documentation
¶
Index ¶
- Constants
- func CheckOrCreateDir(path string) error
- func CreateNewPpmConfig(path string) error
- func DoesPathExist(path string) (bool, error)
- func Filter[T any](arr []T, predicate func(T, int) bool) []T
- func GetFirstMatch[T any](arr []T, predicate func(T, int) bool) *T
- func GetPathsAndConfig() (Paths, PpmConfig, error)
- func GetPluginIdentifier(name string) string
- func GetPluginName(name string) string
- func GetVersionOrNot(dependency string) (string, string)
- func IndexOf[T comparable](target T, data []T) int
- func IsAssetDependency(str string) bool
- func IsGithubRepoUrl(str string) bool
- func IsUrl(str string) bool
- func IsUserAndRepo(str string) bool
- func Map[T any, N any](arr []T, predicate func(T, int) N) []N
- func PrintDone()
- func SliceContains[T comparable](target T, data []T) bool
- func SliceToString(slice []string, seperator string) string
- func Some[T any](arr []T, predicate func(T, int) bool) bool
- func UpdateGithubRepo(path string) error
- type Dependency
- type LoadingVisualization
- type Paths
- type PpmConfig
- func (ppm *PpmConfig) AddDependency(dependency *Dependency)
- func (ppm *PpmConfig) AddSubDependency(dependency *Dependency)
- func (ppm PpmConfig) HasDependency(dependency *Dependency) bool
- func (ppm PpmConfig) HasSubDependency(dependency *Dependency) bool
- func (ppm PpmConfig) PrettyPrint()
- func (ppm *PpmConfig) RemoveAllDependencies()
- func (ppm *PpmConfig) RemoveDependency(dependency *Dependency)
- func (ppm *PpmConfig) RemoveSubDependency(dependency *Dependency)
- func (ppm PpmConfig) Write() error
Constants ¶
const ( GithubAsset = "GITHUB_ASSET" GDAsset = "GODOT_ASSET" )
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 Filter ¶ added in v1.1.4
returns a new slice containing all the items on which the predicate returns true
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 GetPluginIdentifier ¶ added in v1.1.4
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 IsAssetDependency ¶ added in v1.2.0
func IsGithubRepoUrl ¶ added in v1.1.3
func IsUserAndRepo ¶ added in v1.1.3
func SliceContains ¶ added in v1.1.2
func SliceContains[T comparable](target T, data []T) bool
check whether a certain item exists in a string slice
func SliceToString ¶ added in v1.1.2
func UpdateGithubRepo ¶ added in v1.2.0
update a certain repository
Types ¶
type Dependency ¶ added in v1.2.0
type Dependency struct { Identifier string `json:"identifier"` Url string `json:"url"` Type string `json:"type"` }
func DependencyFromString ¶ added in v1.2.0
func DependencyFromString(str string) *Dependency
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 []*Dependency `json:"dependencies"` SubDependencies []*Dependency `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 ¶
func (ppm *PpmConfig) AddDependency(dependency *Dependency)
add an item safely to the Dependencies property
func (*PpmConfig) AddSubDependency ¶
func (ppm *PpmConfig) AddSubDependency(dependency *Dependency)
add an item safely to the sub-dependencies property
func (PpmConfig) HasDependency ¶
func (ppm PpmConfig) HasDependency(dependency *Dependency) bool
check wether the config file has a certain dependency
func (PpmConfig) HasSubDependency ¶
func (ppm PpmConfig) HasSubDependency(dependency *Dependency) bool
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 ¶
func (ppm *PpmConfig) RemoveDependency(dependency *Dependency)
remove an item safely from the sub-dependencies property by its name
func (*PpmConfig) RemoveSubDependency ¶
func (ppm *PpmConfig) RemoveSubDependency(dependency *Dependency)
remove an item safely from the Dependencies property by its name