Documentation
¶
Index ¶
Constants ¶
const ( GitHubRepo = "https://github.com/community-scripts/ProxmoxVE" GitHubAPIRepo = "https://api.github.com/repos/community-scripts/ProxmoxVE" RawGitHubRepo = "https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main" )
GitHubRepo is the URL to the Proxmox Community Scripts repository.
const ( ScriptMetadataTTL = 24 * time.Hour // Cache script metadata for 24 hours ScriptListTTL = 12 * time.Hour // Cache script list for 12 hours )
Cache TTLs.
const ( ScriptListCacheKey = "github_script_list" ScriptCacheKeyPrefix = "github_script_" )
Cache keys.
Variables ¶
This section is empty.
Functions ¶
func InstallScript ¶
InstallScript installs a script on a Proxmox node interactively.
func ValidateConnection ¶
ValidateConnection checks if SSH connection to the node is possible.
Types ¶
type GitHubContent ¶
type GitHubContent struct {
Name string `json:"name"`
Path string `json:"path"`
Type string `json:"type"` // "file" or "dir"
DownloadURL string `json:"download_url"`
}
GitHubContent represents a file or directory in the GitHub API.
func GetScriptMetadataFiles ¶
func GetScriptMetadataFiles() ([]GitHubContent, error)
GetScriptMetadataFiles fetches the list of script metadata JSON files from the repository.
type Script ¶
type Script struct {
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
Categories []int `json:"categories"`
Type string `json:"type"` // "ct" for containers, "vm" for VMs
Updateable bool `json:"updateable"`
Privileged bool `json:"privileged"`
InterfacePort int `json:"interface_port"`
Documentation string `json:"documentation"`
Website string `json:"website"`
ConfigPath string `json:"config_path"`
Logo string `json:"logo"`
ScriptPath string // Added for our use, not in the JSON
DateCreated string `json:"date_created"`
}
Script represents a single script from the repository.
func FetchScripts ¶
FetchScripts fetches all available scripts from the repository.
func GetScriptMetadata ¶
GetScriptMetadata fetches and parses the metadata for a specific script.
func GetScriptsByCategory ¶
GetScriptsByCategory returns scripts for a specific category.
type ScriptCategory ¶
ScriptCategory represents a category of Proxmox scripts.
func GetScriptCategories ¶
func GetScriptCategories() []ScriptCategory
GetScriptCategories returns the available script categories.