Documentation
¶
Index ¶
- Constants
- func DefaultInstallerCacheDir() string
- func ResolveWithinRoot(root string, relativePath string) (resolved string, err error)
- type APIProxyOptions
- type Action
- type AddonPackage
- type AddonSelection
- type ApplyResult
- type Architecture
- type BuildVariant
- type Candidate
- type ContentCatalogue
- type ContentCatalogueOptions
- type ContentRequest
- type ContentSource
- type ContentSourceKind
- type DiscoveryOptions
- type DiscoveryResult
- type DiscoveryWarning
- type Drift
- type EffectPackage
- type EffectPackageSelection
- type InstallerAcknowledgements
- type InstallerAcquireOptions
- type InstallerArtifact
- type InstallerPlannerOptions
- type InstallerProvenance
- type InstallerRelease
- type InstallerReleaseStatus
- type InstallerResolveOptions
- type InstallerSignature
- type InstallerSignatureStatus
- type InstallerSignatureVerifier
- type InstallerStatus
- type InstallerVariant
- type ManagedFile
- type ManagedTarget
- type ManagementStatus
- type Manager
- func (m *Manager) Apply(ctx context.Context, gameRoot string, request Request, previewHash string) (result ApplyResult, err error)
- func (m *Manager) ListContentCatalogue(ctx context.Context, refresh bool) (ContentCatalogue, error)
- func (m *Manager) ListTargets(ctx context.Context, gameRoot string, gameID int64) (targets []ManagedTarget, err error)
- func (m *Manager) Preview(ctx context.Context, gameRoot string, request Request) (preview Preview, err error)
- func (m *Manager) RecoveryState() (state RecoveryState, err error)
- func (m *Manager) RollbackRecovery(journalID string) (result ApplyResult, err error)
- type ManagerOptions
- type Manifest
- type Operation
- type Ownership
- type PathImpact
- type PathRole
- type Planner
- type PlannerFunc
- type PreparedSetup
- type PreparedSetupFile
- type PresetInspectionResult
- type PresetRecommendation
- type Preview
- type ProxyEvidence
- type RecoveryState
- type RenderingAPI
- type Request
- type Result
- type SetupExecutionResult
- type SetupInput
- type SetupOperation
- type SetupRequest
- type SetupRunResult
- type SetupRunnerOptions
- type Store
- type Target
- type TargetState
- type UserContent
- type UserContentDrift
- type VariantProvenance
Constants ¶
View Source
const ( DefaultEffectCatalogueURL = "https://raw.githubusercontent.com/crosire/reshade-shaders/list/EffectPackages.ini" DefaultAddonCatalogueURL = "https://raw.githubusercontent.com/crosire/reshade-shaders/list/Addons.ini" )
View Source
const ( DefaultSetupTimeout = 5 * time.Minute DefaultSetupOutputLimitBytes = 1024 * 1024 )
View Source
const ( ManifestVersion = 1 JournalVersion = 1 )
View Source
const DefaultDownloadBaseURL = "https://reshade.me/downloads"
Variables ¶
This section is empty.
Functions ¶
func DefaultInstallerCacheDir ¶
func DefaultInstallerCacheDir() string
Types ¶
type APIProxyOptions ¶
type APIProxyOptions struct {
RenderingAPI RenderingAPI `json:"renderingApi"`
Proxies []string `json:"proxies"`
}
type AddonPackage ¶
type AddonPackage struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
EffectInstallPath string `json:"effectInstallPath,omitempty"`
DownloadURL string `json:"downloadUrl,omitempty"`
DownloadURL32 string `json:"downloadUrl32,omitempty"`
DownloadURL64 string `json:"downloadUrl64,omitempty"`
RepositoryURL string `json:"repositoryUrl"`
}
type AddonSelection ¶
type AddonSelection struct {
ID string `json:"id"`
}
type ApplyResult ¶
type Architecture ¶
type Architecture string
const ( ArchitectureX86 Architecture = "x86" ArchitectureX64 Architecture = "x64" )
type BuildVariant ¶
type BuildVariant string
const ( BuildVariantStandard BuildVariant = "standard" BuildVariantAddon BuildVariant = "addon" )
type Candidate ¶
type Candidate struct {
TargetRelativePath string `json:"targetRelativePath"`
ExecutableRelativePath string `json:"executableRelativePath"`
Architecture Architecture `json:"architecture"`
APIOptions []APIProxyOptions `json:"apiOptions"`
ProxyEvidence []ProxyEvidence `json:"proxyEvidence"`
Conflicts []string `json:"conflicts"`
}
type ContentCatalogue ¶
type ContentCatalogue struct {
Effects []EffectPackage `json:"effects"`
Addons []AddonPackage `json:"addons"`
Cached bool `json:"cached"`
}
func ListContentCatalogue ¶
func ListContentCatalogue(ctx context.Context, dataDir string, refresh bool, options ContentCatalogueOptions) (catalogue ContentCatalogue, err error)
type ContentCatalogueOptions ¶
type ContentRequest ¶
type ContentRequest struct {
EffectPackages []EffectPackageSelection `json:"effectPackages,omitempty"`
Addons []AddonSelection `json:"addons,omitempty"`
}
type ContentSource ¶
type ContentSource struct {
Kind ContentSourceKind `json:"kind"`
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
RepositoryURL string `json:"repositoryUrl,omitempty"`
DownloadURL string `json:"downloadUrl,omitempty"`
ArchiveSHA256 string `json:"archiveSha256,omitempty"`
ArchiveSize int64 `json:"archiveSizeBytes,omitempty"`
}
type ContentSourceKind ¶
type ContentSourceKind string
const ( ContentSourceRuntime ContentSourceKind = "runtime" ContentSourceEffectPackage ContentSourceKind = "effect_package" ContentSourceAddon ContentSourceKind = "addon" )
type DiscoveryOptions ¶
type DiscoveryOptions struct {
InspectArchitecture func(string) (Architecture, error)
ReadMetadata func(string) (winversion.Metadata, error)
AllowedForeignProxyPaths []string
}
type DiscoveryResult ¶
type DiscoveryResult struct {
Candidates []Candidate `json:"candidates"`
Warnings []DiscoveryWarning `json:"warnings"`
}
func DiscoverCandidates ¶
func DiscoverCandidates(gameRoot string, options DiscoveryOptions) (result DiscoveryResult, err error)
type DiscoveryWarning ¶
type EffectPackage ¶
type EffectPackage struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
InstallPath string `json:"installPath"`
TextureInstallPath string `json:"textureInstallPath"`
DownloadURL string `json:"downloadUrl"`
RepositoryURL string `json:"repositoryUrl"`
Required bool `json:"required"`
Enabled bool `json:"enabled"`
Modifiable bool `json:"modifiable"`
EffectFiles []string `json:"effectFiles"`
DenyEffectFiles []string `json:"denyEffectFiles"`
}
type EffectPackageSelection ¶
type InstallerAcquireOptions ¶
type InstallerAcquireOptions struct {
CacheDir string
HTTPClient *http.Client
SignatureVerifier InstallerSignatureVerifier
Acknowledgements InstallerAcknowledgements
TrustedDownloadHosts []string
AllowHTTP bool
}
type InstallerArtifact ¶
type InstallerArtifact struct {
InstallerRelease
Path string `json:"path"`
SizeBytes int64 `json:"sizeBytes"`
SHA256 string `json:"sha256"`
Signature InstallerSignature `json:"signature"`
}
func AcquireInstaller ¶
func AcquireInstaller( ctx context.Context, release InstallerRelease, options InstallerAcquireOptions, ) (artifact InstallerArtifact, err error)
type InstallerPlannerOptions ¶
type InstallerPlannerOptions struct {
ResolveInstaller func(context.Context, InstallerVariant, InstallerResolveOptions) (InstallerRelease, error)
AcquireInstaller func(context.Context, InstallerRelease, InstallerAcquireOptions) (InstallerArtifact, error)
PrepareSetup func(context.Context, SetupRequest, SetupRunnerOptions) (SetupRunResult, error)
InspectArchitecture func(string) (Architecture, error)
ReadMetadata func(string) (winversion.Metadata, error)
}
type InstallerProvenance ¶
type InstallerRelease ¶
type InstallerRelease struct {
Version string `json:"version"`
Variant InstallerVariant `json:"variant"`
AssetName string `json:"assetName"`
URL string `json:"url"`
SHA256 string `json:"sha256,omitempty"`
SizeBytes int64 `json:"sizeBytes,omitempty"`
}
func ResolveLatestInstaller ¶
func ResolveLatestInstaller( ctx context.Context, variant InstallerVariant, options InstallerResolveOptions, ) (release InstallerRelease, err error)
type InstallerReleaseStatus ¶
type InstallerReleaseStatus struct {
Version string `json:"version"`
Variant InstallerVariant `json:"variant"`
AssetName string `json:"assetName"`
URL string `json:"url"`
Digest *string `json:"digest,omitempty"`
Size *int64 `json:"sizeBytes,omitempty"`
Cached bool `json:"cached"`
Error string `json:"error,omitempty"`
}
type InstallerResolveOptions ¶
type InstallerSignature ¶
type InstallerSignature struct {
Status InstallerSignatureStatus `json:"status"`
Subject string `json:"subject,omitempty"`
SPKISHA256 string `json:"spkiSha256,omitempty"`
CertificateSHA1 string `json:"certificateSha1,omitempty"`
}
func (InstallerSignature) MatchesIdentity ¶
func (s InstallerSignature) MatchesIdentity(other InstallerSignature) bool
type InstallerSignatureStatus ¶
type InstallerSignatureStatus string
const ( InstallerSignatureStatusVerified InstallerSignatureStatus = "verified" InstallerSignatureStatusUnsigned InstallerSignatureStatus = "unsigned" )
type InstallerSignatureVerifier ¶
type InstallerSignatureVerifier interface {
VerifyInstallerSignature(string, InstallerVariant) (InstallerSignature, error)
}
type InstallerStatus ¶
type InstallerStatus struct {
Standard InstallerReleaseStatus `json:"standard"`
Addon InstallerReleaseStatus `json:"addon"`
}
func ResolveInstallerStatus ¶
func ResolveInstallerStatus(ctx context.Context, refresh bool) InstallerStatus
type InstallerVariant ¶
type InstallerVariant string
const ( InstallerVariantStandard InstallerVariant = "" InstallerVariantAddon InstallerVariant = "addon" )
type ManagedFile ¶
type ManagedFile struct {
RelativePath string `json:"relativePath"`
SHA256 string `json:"sha256"`
SizeBytes int64 `json:"sizeBytes"`
Ownership Ownership `json:"ownership"`
Role PathRole `json:"role,omitempty"`
Source *ContentSource `json:"source,omitempty"`
Sources []ContentSource `json:"sources,omitempty"`
BackupPath *string `json:"backupPath,omitempty"`
BackupSHA256 *string `json:"backupSha256,omitempty"`
BackupSize *int64 `json:"backupSizeBytes,omitempty"`
}
type ManagedTarget ¶
type ManagedTarget struct {
ID int64
GameID int64
TargetRelativePath string
ExecutableRelativePath string
RenderingAPI RenderingAPI
ProxyFilename string
ActiveRuntimeFilename string
Architecture Architecture
BuildVariant BuildVariant
VariantProvenance VariantProvenance
RuntimeVersion string
Provenance InstallerProvenance
ManagementOrigin string
Status ManagementStatus
CreatedAt string
UpdatedAt string
LastVerifiedAt *string
}
type ManagementStatus ¶
type ManagementStatus string
const ( ManagementStatusUnmanaged ManagementStatus = "unmanaged" ManagementStatusManaged ManagementStatus = "managed" ManagementStatusDrifted ManagementStatus = "drifted" ManagementStatusRecoveryRequired ManagementStatus = "recovery_required" ManagementStatusIncompatibleManifest ManagementStatus = "incompatible_manifest" )
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(store Store, options ManagerOptions) *Manager
func (*Manager) ListContentCatalogue ¶
func (*Manager) ListTargets ¶
func (*Manager) RecoveryState ¶
func (m *Manager) RecoveryState() (state RecoveryState, err error)
func (*Manager) RollbackRecovery ¶
func (m *Manager) RollbackRecovery(journalID string) (result ApplyResult, err error)
type ManagerOptions ¶
type Manifest ¶
type Manifest struct {
Version int `json:"version"`
Files []ManagedFile `json:"files"`
HasPreAdoptionRollbackData bool `json:"hasPreAdoptionRollbackData"`
VariantProvenance VariantProvenance `json:"variantProvenance,omitempty"`
UserContent []UserContent `json:"userContent,omitempty"`
}
func DecodeManifest ¶
type PathImpact ¶
type PathRole ¶
type PathRole string
const ( PathRoleRuntime PathRole = "runtime" PathRoleConfiguration PathRole = "configuration" PathRolePreset PathRole = "preset" PathRoleLog PathRole = "log" PathRoleBackup PathRole = "backup" PathRoleEffects PathRole = "effects" PathRoleTextures PathRole = "textures" PathRoleAddons PathRole = "addons" PathRoleScreenshots PathRole = "screenshots" )
type Planner ¶
type Planner interface {
Plan(context.Context, string, Request, *dbtypes.ReShadeTarget) (Preview, error)
}
func NewInstallerPlanner ¶
func NewInstallerPlanner(options InstallerPlannerOptions) Planner
type PlannerFunc ¶
type PreparedSetup ¶
type PreparedSetup struct {
WorkspacePath string `json:"workspacePath"`
Artifact InstallerArtifact `json:"artifact"`
ExecutableSHA string `json:"executableSha256"`
RenderingAPI RenderingAPI `json:"renderingApi"`
Operation SetupOperation `json:"operation"`
Architecture Architecture `json:"architecture"`
ExpectedProxy string `json:"expectedProxy"`
Files []PreparedSetupFile `json:"files"`
Execution SetupExecutionResult `json:"execution"`
}
type PreparedSetupFile ¶
type PresetInspectionResult ¶
type PresetInspectionResult struct {
ReferencedEffects []string `json:"referencedEffects"`
Recommendations []PresetRecommendation `json:"recommendations"`
MissingEffects []string `json:"missingEffects"`
Warnings []string `json:"warnings"`
}
func InspectPreset ¶
func InspectPreset(path string, catalogue ContentCatalogue) (result PresetInspectionResult, err error)
type PresetRecommendation ¶
type Preview ¶
type Preview struct {
Request Request `json:"request"`
Operations []Operation `json:"operations"`
PathImpacts []PathImpact `json:"pathImpacts"`
Warnings []string `json:"warnings"`
Conflicts []string `json:"conflicts"`
Drift []Drift `json:"drift"`
UserContentDrift []UserContentDrift `json:"userContentDrift"`
DesiredTarget *TargetState `json:"desiredTarget,omitempty"`
PreviewHash string `json:"previewHash"`
CanApply bool `json:"canApply"`
}
type ProxyEvidence ¶
type RecoveryState ¶
type RecoveryState struct {
Required bool `json:"required"`
JournalID string `json:"journalId,omitempty"`
GameID int64 `json:"gameId,omitempty"`
TargetPath string `json:"targetPath,omitempty"`
Action Action `json:"action,omitempty"`
StartedAt time.Time `json:"startedAt,omitempty"`
Error string `json:"error,omitempty"`
}
type RenderingAPI ¶
type RenderingAPI string
const ( RenderingAPID3D9 RenderingAPI = "d3d9" RenderingAPID3D10 RenderingAPI = "d3d10" RenderingAPID3D11 RenderingAPI = "d3d11" RenderingAPID3D12 RenderingAPI = "d3d12" RenderingAPIOpenGL RenderingAPI = "opengl" )
type Request ¶
type Request struct {
Action Action `json:"action"`
GameID int64 `json:"gameId"`
TargetRelativePath string `json:"targetRelativePath"`
ExecutableRelativePath string `json:"executableRelativePath"`
RenderingAPI RenderingAPI `json:"renderingApi"`
ProxyFilename string `json:"proxyFilename"`
ActiveRuntimeFilename string `json:"activeRuntimeFilename,omitempty"`
OptiScalerPrimaryProxyFilename string `json:"optiScalerPrimaryProxyFilename,omitempty"`
Architecture Architecture `json:"architecture"`
BuildVariant BuildVariant `json:"buildVariant"`
BackupAndContinue bool `json:"backupAndContinue"`
SinglePlayerAcknowledged bool `json:"singlePlayerAcknowledged"`
AntiCheatRiskAcknowledged bool `json:"antiCheatRiskAcknowledged"`
Content ContentRequest `json:"content,omitempty"`
}
type SetupExecutionResult ¶
type SetupExecutionResult struct {
Arguments []string `json:"arguments"`
ExitCode int `json:"exitCode"`
StartedAt time.Time `json:"startedAt"`
FinishedAt time.Time `json:"finishedAt"`
Duration time.Duration `json:"duration"`
Stdout string `json:"stdout"`
Stderr string `json:"stderr"`
StdoutTruncated bool `json:"stdoutTruncated"`
StderrTruncated bool `json:"stderrTruncated"`
Cancelled bool `json:"cancelled"`
TimedOut bool `json:"timedOut"`
ElevationNeeded bool `json:"elevationNeeded"`
Cached bool `json:"cached"`
}
type SetupInput ¶
type SetupOperation ¶
type SetupOperation string
const ( SetupOperationInstall SetupOperation = "install" SetupOperationUpdate SetupOperation = "update" )
type SetupRequest ¶
type SetupRequest struct {
Artifact InstallerArtifact
TargetExecutable string
RenderingAPI RenderingAPI
Operation SetupOperation
Architecture Architecture
ExpectedProxy string
AllowedProxyOutputRelativePaths []string
ExistingInputs []SetupInput
ExpectedOutputRelativePaths []string
Acknowledgements InstallerAcknowledgements
Timeout time.Duration
}
type SetupRunResult ¶
type SetupRunResult struct {
Execution SetupExecutionResult `json:"execution"`
Prepared *PreparedSetup `json:"prepared,omitempty"`
}
func PrepareSetup ¶
func PrepareSetup( ctx context.Context, request SetupRequest, options SetupRunnerOptions, ) (result SetupRunResult, err error)
type SetupRunnerOptions ¶
type SetupRunnerOptions struct {
WorkspaceRoot string
ProcessRunner setupProcessRunner
SignatureVerifier InstallerSignatureVerifier
ReadMetadata func(string) (winversion.Metadata, error)
InspectArchitecture func(string) (Architecture, error)
OutputLimitBytes int
}
type Store ¶
type Store interface {
GetReShadeTarget(context.Context, int64, string) (dbtypes.ReShadeTarget, bool, error)
ListReShadeTargets(context.Context, int64) ([]dbtypes.ReShadeTarget, error)
SaveReShadeTarget(context.Context, dbtypes.SaveReShadeTargetInput) (dbtypes.ReShadeTarget, error)
DeleteReShadeTarget(context.Context, int64, string) error
}
type TargetState ¶
type TargetState struct {
RuntimeVersion string `json:"runtimeVersion"`
Provenance InstallerProvenance `json:"provenance"`
ManagementOrigin string `json:"managementOrigin"`
Manifest Manifest `json:"manifest"`
}
type UserContent ¶
type UserContent struct {
Path string `json:"path"`
Role PathRole `json:"role"`
SHA256 string `json:"sha256,omitempty"`
SizeBytes int64 `json:"sizeBytes,omitempty"`
Exists bool `json:"exists"`
External bool `json:"external"`
Directory bool `json:"directory"`
InventoryOnly bool `json:"inventoryOnly"`
}
type UserContentDrift ¶
type VariantProvenance ¶
type VariantProvenance string
const ( VariantProvenanceVerified VariantProvenance = "verified" VariantProvenanceUserDeclared VariantProvenance = "user_declared" )
Source Files
¶
- content.go
- content_archive.go
- content_catalogue.go
- content_ini.go
- content_planner.go
- content_preset.go
- discovery.go
- execute.go
- installer.go
- installer_acquisition.go
- installer_planner.go
- installer_signature_other.go
- installer_signature_policy.go
- installer_status.go
- installer_version.go
- journal.go
- manager.go
- manifest.go
- paths.go
- scan.go
- setup_process_other.go
- setup_runner.go
- storage_helpers.go
- types.go
Click to show internal directories.
Click to hide internal directories.