Documentation ¶
Overview ¶
Copyright 2025 Tristan Isham. All rights reserved. Use of this source code is governed by the MIT license that can be found in the LICENSE file.
Copyright 2025 Tristan Isham. All rights reserved. Use of this source code is governed by the MIT license that can be found in the LICENSE file.
Index ¶
- Variables
- func CanIUpgrade() (string, bool, error)
- func ExtractBundle(bundle, out string) error
- func ExtractInstall(input string) installRequest
- func LoadMasterVersion(zigMap *zigVersionMap) string
- type GithubRelease
- type Settings
- func (s *Settings) NoColor()
- func (s *Settings) ResetVersionMap() error
- func (s *Settings) ResetZlsVMU() error
- func (s *Settings) SetColor(answer bool)
- func (s *Settings) SetVersionMapUrl(versionMapUrl string) error
- func (s *Settings) SetZlsVMU(versionMapUrl string) error
- func (s *Settings) ToggleColor()
- func (s *Settings) YesColor()
- type ZVM
- func (z *ZVM) Clean() error
- func (z *ZVM) GetInstalledVersions() ([]string, error)
- func (z *ZVM) Install(version string, force bool) error
- func (z *ZVM) InstallZls(requestedVersion string, compatMode string, force bool) error
- func (z ZVM) ListRemoteAvailable() error
- func (z *ZVM) ListVersions() error
- func (z *ZVM) Run(version string, cmd []string) error
- func (z *ZVM) SelectZlsVersion(version string, compatMode string) (string, string, string, error)
- func (z *ZVM) Sync() error
- func (z *ZVM) Uninstall(ver string) error
- func (z *ZVM) Upgrade() error
- func (z *ZVM) Use(ver string) error
- type ZigOnlVersion
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingBundlePath = errors.New("bundle download path not found") ErrUnsupportedSystem = errors.New("unsupported system for Zig") ErrUnsupportedVersion = errors.New("unsupported Zig version") ErrMissingInstallPathEnv = errors.New("env 'ZVM_INSTALL' is not set") ErrFailedUpgrade = errors.New("failed to self-upgrade zvm") ErrInvalidVersionMap = errors.New("invalid version map format") ErrInvalidInput = errors.New("invalid input") // ErrDownloadFail is an an error when fetching Zig, or constructing a target URL to fetch Zig. ErrDownloadFail = errors.New("failed to download Zig") ErrNoZlsVersion = errors.New("zls release worker returned error") ErrMissingVersionInfo = errors.New("version info not found") ErrMissingShasum = errors.New("shasum not found") )
View Source
var ErrNoSettings = errors.New("settings.json not found")
Functions ¶
func CanIUpgrade ¶
func ExtractBundle ¶
func ExtractInstall ¶
func ExtractInstall(input string) installRequest
func LoadMasterVersion ¶
func LoadMasterVersion(zigMap *zigVersionMap) string
LoadMasterVersion takes a zigVersionMap and returns the master disto's version if it's present. If it's not, this function returns an empty string.
Types ¶
type GithubRelease ¶
type GithubRelease struct { CreatedAt time.Time `json:"created_at"` PublishedAt time.Time `json:"published_at"` TargetCommitish string `json:"target_commitish"` Name string `json:"name"` Body string `json:"body"` ZipballURL string `json:"zipball_url"` NodeID string `json:"node_id"` TagName string `json:"tag_name"` URL string `json:"url"` HTMLURL string `json:"html_url"` TarballURL string `json:"tarball_url"` AssetsURL string `json:"assets_url"` UploadURL string `json:"upload_url"` Assets []struct { UpdatedAt time.Time `json:"updated_at"` CreatedAt time.Time `json:"created_at"` Label interface{} `json:"label"` ContentType string `json:"content_type"` Name string `json:"name"` URL string `json:"url"` State string `json:"state"` NodeID string `json:"node_id"` BrowserDownloadURL string `json:"browser_download_url"` Uploader struct { FollowingURL string `json:"following_url"` NodeID string `json:"node_id"` GistsURL string `json:"gists_url"` StarredURL string `json:"starred_url"` GravatarID string `json:"gravatar_id"` URL string `json:"url"` HTMLURL string `json:"html_url"` FollowersURL string `json:"followers_url"` Login string `json:"login"` Type string `json:"type"` AvatarURL string `json:"avatar_url"` SubscriptionsURL string `json:"subscriptions_url"` OrganizationsURL string `json:"organizations_url"` ReposURL string `json:"repos_url"` EventsURL string `json:"events_url"` ReceivedEventsURL string `json:"received_events_url"` ID int `json:"id"` SiteAdmin bool `json:"site_admin"` } `json:"uploader"` Size int `json:"size"` DownloadCount int `json:"download_count"` ID int `json:"id"` } `json:"assets"` Author struct { FollowingURL string `json:"following_url"` NodeID string `json:"node_id"` GistsURL string `json:"gists_url"` StarredURL string `json:"starred_url"` GravatarID string `json:"gravatar_id"` URL string `json:"url"` HTMLURL string `json:"html_url"` FollowersURL string `json:"followers_url"` Login string `json:"login"` Type string `json:"type"` AvatarURL string `json:"avatar_url"` SubscriptionsURL string `json:"subscriptions_url"` OrganizationsURL string `json:"organizations_url"` ReposURL string `json:"repos_url"` EventsURL string `json:"events_url"` ReceivedEventsURL string `json:"received_events_url"` ID int `json:"id"` SiteAdmin bool `json:"site_admin"` } `json:"author"` ID int `json:"id"` Prerelease bool `json:"prerelease"` Draft bool `json:"draft"` }
type Settings ¶
type Settings struct { VersionMapUrl string `json:"versionMapUrl,omitempty"` // Zig's version map URL ZlsVMU string `json:"zlsVersionMapUrl,omitempty"` // ZLS's version map URL UseColor bool `json:"useColor"` AlwaysForceInstall bool `json:"alwaysForceInstall"` // contains filtered or unexported fields }
func (*Settings) ResetVersionMap ¶
func (*Settings) ResetZlsVMU ¶ added in v0.7.8
func (*Settings) SetVersionMapUrl ¶
func (*Settings) ToggleColor ¶
func (s *Settings) ToggleColor()
type ZVM ¶
type ZVM struct { Settings Settings // contains filtered or unexported fields }
func Initialize ¶
func Initialize() *ZVM
func (*ZVM) GetInstalledVersions ¶ added in v0.7.6
func (*ZVM) InstallZls ¶
func (ZVM) ListRemoteAvailable ¶
func (*ZVM) ListVersions ¶
func (*ZVM) SelectZlsVersion ¶ added in v0.7.7
type ZigOnlVersion ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.