Documentation ¶
Overview ¶
Copyright 2022 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() (bool, string, error)
- func ExtractBundle(bundle, out string) error
- func LoadMasterVersion(zigMap *zigVersionMap) string
- type GithubRelease
- type InstallRequest
- type Settings
- type ZVM
- func (z *ZVM) Clean() error
- func (z *ZVM) Install(version string) error
- func (z *ZVM) InstallZls(version string) error
- func (z ZVM) ListRemoteAvailable() error
- func (z *ZVM) ListVersions() 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") )
View Source
var (
ErrNoSettings = errors.New("settings.json not found")
)
Functions ¶
func CanIUpgrade ¶
func ExtractBundle ¶
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 { URL string `json:"url"` AssetsURL string `json:"assets_url"` UploadURL string `json:"upload_url"` HTMLURL string `json:"html_url"` ID int `json:"id"` Author struct { Login string `json:"login"` ID int `json:"id"` NodeID string `json:"node_id"` AvatarURL string `json:"avatar_url"` GravatarID string `json:"gravatar_id"` URL string `json:"url"` HTMLURL string `json:"html_url"` FollowersURL string `json:"followers_url"` FollowingURL string `json:"following_url"` GistsURL string `json:"gists_url"` StarredURL string `json:"starred_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"` Type string `json:"type"` SiteAdmin bool `json:"site_admin"` } `json:"author"` NodeID string `json:"node_id"` TagName string `json:"tag_name"` TargetCommitish string `json:"target_commitish"` Name string `json:"name"` Draft bool `json:"draft"` Prerelease bool `json:"prerelease"` CreatedAt time.Time `json:"created_at"` PublishedAt time.Time `json:"published_at"` Assets []struct { URL string `json:"url"` ID int `json:"id"` NodeID string `json:"node_id"` Name string `json:"name"` Label interface{} `json:"label"` Uploader struct { Login string `json:"login"` ID int `json:"id"` NodeID string `json:"node_id"` AvatarURL string `json:"avatar_url"` GravatarID string `json:"gravatar_id"` URL string `json:"url"` HTMLURL string `json:"html_url"` FollowersURL string `json:"followers_url"` FollowingURL string `json:"following_url"` GistsURL string `json:"gists_url"` StarredURL string `json:"starred_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"` Type string `json:"type"` SiteAdmin bool `json:"site_admin"` } `json:"uploader"` ContentType string `json:"content_type"` State string `json:"state"` Size int `json:"size"` DownloadCount int `json:"download_count"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` BrowserDownloadURL string `json:"browser_download_url"` } `json:"assets"` TarballURL string `json:"tarball_url"` ZipballURL string `json:"zipball_url"` Body string `json:"body"` }
type InstallRequest ¶
type InstallRequest struct {
Site, Package, Version string
}
func ExtractInstall ¶
func ExtractInstall(input string) InstallRequest
type Settings ¶
type Settings struct { UseColor bool `json:"useColor"` VersionMapUrl string `json:"versionMapUrl,omitempty"` // contains filtered or unexported fields }
func (*Settings) ResetVersionMap ¶
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) InstallZls ¶
func (ZVM) ListRemoteAvailable ¶
func (*ZVM) ListVersions ¶
type ZigOnlVersion ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.