install

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrManifestNotExists            = errors.New("manifest does not exists")
	ErrRemoteFileSchemeNotSupported = errors.New("file scheme with remote host not supported")
)
View Source
var (
	ErrMissingSourceType        = errors.New("missing type attribute in source")
	ErrUnknownSourceType        = errors.New("unknown source type")
	ErrMissingDepotManifestType = errors.New("missing type attribute in depot manifest")
	ErrUnknownDepotManifestType = errors.New("unknown depot manifest type")
)

Functions

This section is empty.

Types

type Base64Source added in v0.5.0

type Base64Source struct {
	Content string `mapstructure:"content,omitempty"`
}

func (*Base64Source) Download added in v0.6.0

func (s *Base64Source) Download(ctx context.Context, dl *Downloader, dst string) error

func (*Base64Source) GetDownloaderOptions added in v0.5.0

func (s *Base64Source) GetDownloaderOptions() []DownloaderOptFunc

type Depot added in v0.6.0

type Depot struct {
	Name     string         `mapstructure:"name,omitempty"`
	Path     string         `mapstructure:"path,omitempty"`
	Config   DepotConfig    `mapstructure:"config,omitempty"`
	Exports  map[string]any `mapstructure:"exports,omitempty"`
	Manifest DepotManifest  `mapstructure:"manifest,omitempty"`
}

type DepotConfig added in v0.6.0

type DepotConfig struct {
	Os   []string `mapstructure:"os,omitempty"`
	Arch []string `mapstructure:"arch,omitempty"`
	Tags []string `mapstructure:"tags,omitempty"`
}

type DepotManifest added in v0.6.0

type DepotManifest interface {
	GetDownloaderOptions() []DownloaderOptFunc
	GetMetadata(context.Context, *Downloader, string) (Metadata, error)
}

type DownloadConfig added in v0.5.0

type DownloadConfig struct {
	TargetOs    string
	TargetArch  string
	TargetLang  string
	InstallDir  string
	LowViolence bool
}

type Downloader added in v0.5.0

type Downloader struct {
	// contains filtered or unexported fields
}

func NewDownloader added in v0.5.0

func NewDownloader(opts ...DownloaderOptFunc) *Downloader

func (*Downloader) GetConfig added in v0.5.0

func (d *Downloader) GetConfig() DownloadConfig

func (*Downloader) GetHttpClient added in v0.5.0

func (d *Downloader) GetHttpClient() *http.Client

func (*Downloader) GetSteamClient added in v0.5.0

func (d *Downloader) GetSteamClient() *steamdl.SteamDownloadClient

func (*Downloader) Initialize added in v0.5.0

func (d *Downloader) Initialize() error

type DownloaderOptFunc added in v0.5.0

type DownloaderOptFunc (func(*Downloader))

func WithDownloadConfig added in v0.5.0

func WithDownloadConfig(config DownloadConfig) DownloaderOptFunc

func WithHttpClient added in v0.5.0

func WithHttpClient() DownloaderOptFunc

func WithSteamClient added in v0.5.0

func WithSteamClient() DownloaderOptFunc

type FilesDepotManifest added in v0.6.0

type FilesDepotManifest struct {
	Files []FilesDepotManifestFile `mapstructure:"files,omitempty"`
}

func (*FilesDepotManifest) GetDownloaderOptions added in v0.6.0

func (manifest *FilesDepotManifest) GetDownloaderOptions() []DownloaderOptFunc

func (*FilesDepotManifest) GetMetadata added in v0.6.0

func (manifest *FilesDepotManifest) GetMetadata(ctx context.Context, dl *Downloader, path string) (Metadata, error)

type FilesDepotManifestFile added in v0.6.0

type FilesDepotManifestFile struct {
	Filename string `mapstructure:"filename,omitempty"`
	Source   Source `mapstructure:"source,omitempty"`
}

type FilesDepotManifestMetadata added in v0.6.0

type FilesDepotManifestMetadata struct {
	Files []FilesDepotManifestFile
}

func (*FilesDepotManifestMetadata) Install added in v0.6.0

func (metadata *FilesDepotManifestMetadata) Install(ctx context.Context, pool pond.Pool, dl *Downloader) (Waiter, error)

type HttpSource added in v0.5.0

type HttpSource struct {
	Url     string `mapstructure:"url,omitempty"`
	Hash    string `mapstructure:"hash,omitempty"`
	Archive string `mapstructure:"archive,omitempty"`
}

func (*HttpSource) Download added in v0.6.0

func (s *HttpSource) Download(ctx context.Context, dl *Downloader, dst string) error

func (*HttpSource) GetDownloaderOptions added in v0.5.0

func (s *HttpSource) GetDownloaderOptions() []DownloaderOptFunc

type Installer

type Installer struct{}

func NewInstaller

func NewInstaller() (*Installer, error)

func (*Installer) GetManifest added in v0.4.0

func (i *Installer) GetManifest(ctx context.Context, path string) (*Manifest, error)

func (*Installer) Install

func (i *Installer) Install(ctx context.Context, m *Manifest, config DownloadConfig) error

type Manifest

type Manifest struct {
	Name   string  `mapstructure:"name,omitempty"`
	Config string  `mapstructure:"config,omitempty"`
	Depots []Depot `mapstructure:"depots,omitempty"`
}

type Metadata added in v0.5.0

type Metadata interface {
	Install(context.Context, pond.Pool, *Downloader) (Waiter, error)
}

type Source

type Source interface {
	GetDownloaderOptions() []DownloaderOptFunc
	Download(context.Context, *Downloader, string) error
}

type SteamDepotManifest added in v0.6.0

type SteamDepotManifest struct {
	AppId uint32 `mapstructure:"appid,omitempty"`
}

func (*SteamDepotManifest) GetDownloaderOptions added in v0.6.0

func (manifest *SteamDepotManifest) GetDownloaderOptions() []DownloaderOptFunc

func (*SteamDepotManifest) GetMetadata added in v0.6.0

func (manifest *SteamDepotManifest) GetMetadata(ctx context.Context, dl *Downloader, path string) (Metadata, error)

type SteamSourceMetadata added in v0.5.0

type SteamSourceMetadata struct {
	AppId       uint32
	Destination string
	Depots      []steamSourceDepotMetadata
}

func (*SteamSourceMetadata) Install added in v0.5.0

func (metadata *SteamSourceMetadata) Install(ctx context.Context, pool pond.Pool, dl *Downloader) (Waiter, error)

type Waiter added in v0.5.0

type Waiter interface {
	Done() <-chan struct{}
	Wait() error
}

Jump to

Keyboard shortcuts

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