Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultReleaseSource fetches releases from the Unity Hub endpoints. DefaultReleaseSource = HTTPReleaseSource{ HTTPClient: http.DefaultClient, PublishedVersionsEndpoint: defaultPublishedReleasesEndpoint, GAArchiveURL: defaultGAArchiveEndpoint, TestingArchiveURL: defaultTestingArchiveEndpoint, } )
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache caches release fetches to save time.
func (*Cache) FetchRelease ¶
func (c *Cache) FetchRelease(platform, version, revision string) (*EditorRelease, error)
FetchRelease implements the Source interface.
type EditorRelease ¶
type EditorRelease struct { Package `json:",inline"` Version string `json:"version"` LTS bool `json:"lts"` Modules []ModuleRelease `json:"modules"` }
EditorRelease represents a single release of a Unity version.
func (*EditorRelease) FindModule ¶
func (r *EditorRelease) FindModule(id string) *ModuleRelease
FindModule returns the first module with a given ID or nil.
type HTTPReleaseSource ¶
type HTTPReleaseSource struct { HTTPClient *http.Client PublishedVersionsEndpoint string GAArchiveURL string TestingArchiveURL string }
HTTPReleaseSource can be used to fetch releases from the official Unity archives.
func (*HTTPReleaseSource) FetchRelease ¶
func (s *HTTPReleaseSource) FetchRelease(platform, version, revision string) (*EditorRelease, error)
FetchRelease implements the Source interface.
func (*HTTPReleaseSource) FetchReleases ¶
func (s *HTTPReleaseSource) FetchReleases(platform string, includeBeta bool) (Releases, error)
FetchReleases implements the Source interface.
type InstallOptions ¶
type InstallOptions struct { Command *string `json:"cmd,omitempty"` Destination *string `json:"destination,omitempty"` // Advanced install options RenameFrom *string `json:"renameFrom"` RenameTo *string `json:"renameTo"` Checksum string `json:"checksum,omitempty"` }
InstallOptions provides the options to configure a package to install.
type ModuleRelease ¶
type ModuleRelease struct { Package `json:",inline"` ID string `json:"id"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Category string `json:"category,omitempty"` Visible bool `json:"visible"` Selected bool `json:"selected"` }
ModuleRelease represents an optional Unity module tied to a specific editor version.
type Package ¶
type Package struct { InstallOptions `json:",inline"` Version string `json:"version"` DownloadURL string `json:"downloadUrl"` DownloadSize int64 `json:"downloadSize"` }
Package represents a single package which will be installed as part of a Unity install.
type Releases ¶
type Releases map[string]*EditorRelease
Releases lists all available releases at a point in time.