Skip to content

InstancePackageController

InstancePackageController exposes instance package export, inspection, and import to the frontend. It stays limited to DTO conversion and feature invocation.

  • Methods: 5
  • Referenced types: 5

Methods

ExportInstance

ExportInstance writes a portable package containing sanitized instance data and metadata.

Go

go
ExportInstance(request ExportInstanceRequest) (PackageManifestDTO, error)

TypeScript

ts
ExportInstance(request: ExportInstanceRequest): Promise<PackageManifestDTO>

Parameters

NameType
requestExportInstanceRequest

Returns

Go typeTypeScript type
PackageManifestDTOPackageManifestDTO

Example

ts
const exportInstance = await ExportInstance({ instanceId: "instance-id", targetPath: "/path/to/file", name: "Example", description: "" })

Source

internal/transport/wails/instance_package_controller.go:31

ImportPackage

ImportPackage creates a managed instance from a validated package.

Go

go
ImportPackage(request ImportInstanceRequest) (OperationDTO, error)

TypeScript

ts
ImportPackage(request: ImportInstanceRequest): Promise<OperationDTO>

Parameters

NameType
requestImportInstanceRequest

Returns

Go typeTypeScript type
OperationDTOOperationDTO

Example

ts
const importPackage = await ImportPackage({ packagePath: "/path/to/file", name: "Example", description: "", directory: "/path/to/directory", gameVersionId: "gameversion-id", installVersion: false, allowIncompatible: false, skipUnavailable: false })

Source

internal/transport/wails/instance_package_controller.go:67

InspectPackage

InspectPackage validates a package and reports its contents before import.

Go

go
InspectPackage(packagePath string) (PackageInspectionDTO, error)

TypeScript

ts
InspectPackage(packagePath: string): Promise<PackageInspectionDTO>

Parameters

NameType
packagePathstring

Returns

Go typeTypeScript type
PackageInspectionDTOPackageInspectionDTO

Example

ts
const inspectPackage = await InspectPackage("/path/to/file")

Source

internal/transport/wails/instance_package_controller.go:47

SelectExportPath

SelectExportPath prompts for the destination of an exported instance package.

Go

go
SelectExportPath(suggestedName string) (string, error)

TypeScript

ts
SelectExportPath(suggestedName: string): Promise<string>

Parameters

NameType
suggestedNamestring

Returns

Go typeTypeScript type
stringstring

Example

ts
const selectExportPath = await SelectExportPath("Example")

Source

internal/transport/wails/instance_package_controller.go:87

SelectPackageFile

SelectPackageFile prompts for an instance package to inspect or import.

Go

go
SelectPackageFile() (string, error)

TypeScript

ts
SelectPackageFile(): Promise<string>

Returns

Go typeTypeScript type
stringstring

Example

ts
const selectPackageFile = await SelectPackageFile()

Source

internal/transport/wails/instance_package_controller.go:112