mirror

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidSpecification = errors.New("invalid specification")
	ErrInvalidURL           = errors.New("invalid URL")
	ErrMissingMirrors       = errors.New("no mirrors provided")
	ErrNotFound             = errors.New("no mirror found")
	ErrNotSupported         = errors.New("mirror not supported")
)

Functions

This section is empty.

Types

type Executable

type Executable interface {
	Mirror

	ExecutableArchive(v version.Version, p platform.Platform) (artifact.Remote[executable.Archive], error)
	ExecutableArchiveChecksums(v version.Version) (artifact.Remote[checksum.Executable], error)
}

Executable is a mirror which hosts Godot executable artifacts. This does not imply that *all* executable versions are hosted, so users should be prepared to handle the case where resolving the artifact URL fails.

type GitHub

type GitHub struct{}

A mirror implementation for fetching artifacts via releases on the Godot GitHub repository.

func (GitHub) Domains

func (m GitHub) Domains() []string

Returns a new 'client.Client' for downloading artifacts from the mirror.

func (GitHub) ExecutableArchive

func (m GitHub) ExecutableArchive(v version.Version, p platform.Platform) (artifact.Remote[executable.Archive], error)

func (GitHub) ExecutableArchiveChecksums

func (m GitHub) ExecutableArchiveChecksums(v version.Version) (artifact.Remote[checksum.Executable], error)

func (GitHub) SourceArchive

func (m GitHub) SourceArchive(v version.Version) (artifact.Remote[source.Archive], error)

func (GitHub) SourceArchiveChecksums

func (m GitHub) SourceArchiveChecksums(v version.Version) (artifact.Remote[checksum.Source], error)

func (GitHub) Supports

func (m GitHub) Supports(v version.Version) bool

Checks whether the version is broadly supported by the mirror. No network request is issued, but this does not guarantee the host has the version. To check whether the host has the version definitively via the network, use the 'checkIfExists' method.

type Mirror

type Mirror interface {
	// Domains returns a slice of domains at which the mirror hosts artifacts.
	Domains() []string

	// Checks whether the version is broadly supported by the mirror. No network
	// request is issued, but this does not guarantee the host has the version.
	// To check whether the host has the version definitively via the network,
	// use the 'Has' method.
	Supports(v version.Version) bool
}

Specifies a host of Godot release artifacts. The associated methods are related to the host itself and not about individual artifacts.

func Select

func Select(
	ctx context.Context,
	v version.Version,
	p platform.Platform,
	mirrors []Mirror,
) (Mirror, error)

Select chooses the best 'Mirror' of those provided for downloading assets corresponding to the specified version and platform of Godot.

type Source

type Source interface {
	Mirror

	SourceArchive(v version.Version) (artifact.Remote[source.Archive], error)
	SourceArchiveChecksums(v version.Version) (artifact.Remote[checksum.Source], error)
}

Source is a mirror which hosts Godot repository source code versions. This does not imply that *all* executable versions are hosted, so users should be prepared to handle the case where resolving the artifact URL fails.

type TuxFamily

type TuxFamily struct{}

A mirror implementation for fetching artifacts via the Godot TuxFamily host.

func (TuxFamily) Domains

func (m TuxFamily) Domains() []string

Returns a new 'client.Client' for downloading artifacts from the mirror.

func (TuxFamily) ExecutableArchive

func (m TuxFamily) ExecutableArchive(
	v version.Version,
	p platform.Platform,
) (artifact.Remote[executable.Archive], error)

func (TuxFamily) ExecutableArchiveChecksums

func (m TuxFamily) ExecutableArchiveChecksums(v version.Version) (artifact.Remote[checksum.Executable], error)

func (TuxFamily) SourceArchive

func (m TuxFamily) SourceArchive(v version.Version) (artifact.Remote[source.Archive], error)

func (TuxFamily) SourceArchiveChecksums

func (m TuxFamily) SourceArchiveChecksums(v version.Version) (artifact.Remote[checksum.Source], error)

func (TuxFamily) Supports

func (m TuxFamily) Supports(v version.Version) bool

Checks whether the version is broadly supported by the mirror. No network request is issued, but this does not guarantee the host has the version. To check whether the host has the version definitively via the network, use the 'checkIfExists' method.

Jump to

Keyboard shortcuts

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