release

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 NewCache

func NewCache(inner Source) *Cache

NewCache creates a release source which caches another release source.

func (*Cache) FetchRelease

func (c *Cache) FetchRelease(platform, version, revision string) (*EditorRelease, error)

FetchRelease implements the Source interface.

func (*Cache) FetchReleases

func (c *Cache) FetchReleases(platform string, includeBeta bool) (Releases, error)

FetchReleases 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.

type Source

type Source interface {
	FetchReleases(platform string, includeBeta bool) (Releases, error)
	FetchRelease(platform, version, revision string) (*EditorRelease, error)
}

Source provides a means of listing released Unity versions with metadata.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL