layout

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2019 License: Apache-2.0 Imports: 12 Imported by: 69

Documentation

Overview

Package layout is used to find parts of the application package to load or run. It can use the running executable directory, or other supplied locations, and find files targeted to a specific abi.

Index

Constants

View Source
const (
	ErrCannotFindPackageFiles = fault.Const("Cannot find package files")
	ErrUnknownABI             = fault.Const("Unknown device ABI: %+v")
)

Variables

This section is empty.

Functions

func DeviceInfo added in v1.2.0

func DeviceInfo(ctx context.Context, os device.OSKind) (file.Path, error)

DeviceInfo returns the device info executable for the given ABI.

func GapidApk

func GapidApk(ctx context.Context, abi *device.ABI) (file.Path, error)

GapidApk returns the path to the gapid.apk corresponding to the given abi.

func Gapir

func Gapir(ctx context.Context, abi *device.ABI) (file.Path, error)

Gapir returns the path to the gapir binary.

func Gapis

func Gapis(ctx context.Context) (file.Path, error)

Gapis returns the path to the gapis binary.

func Gapit

func Gapit(ctx context.Context) (file.Path, error)

Gapit returns the path to the gapir binary.

func GoArgs added in v1.1.0

func GoArgs(ctx context.Context) []string

GoArgs returns additional arguments to pass to go binaries.

func Json

func Json(ctx context.Context, lib LibraryType) (file.Path, error)

Json returns the path to the Vulkan layer JSON definition for the given library.

func Library

func Library(ctx context.Context, lib LibraryType, abi *device.ABI) (file.Path, error)

Library returns the path to the requested library.

func LibraryName added in v1.2.0

func LibraryName(lib LibraryType, abi *device.ABI) string

LibraryName returns the filename of the given Library.

func PerfettoCmd added in v1.6.0

func PerfettoCmd(ctx context.Context, abi *device.ABI) (file.Path, error)

PerfettoCmd returns the device info executable for the given ABI.

func Strings

func Strings(ctx context.Context) (file.Path, error)

Strings returns the path to the binary string table.

Types

type FileLayout

type FileLayout interface {
	// Strings returns the path to the binary string table.
	Strings(ctx context.Context) (file.Path, error)
	// Gapit returns the path to the gapit binary in this layout.
	Gapit(ctx context.Context) (file.Path, error)
	// Gapis returns the path to the gapis binary in this layout.
	Gapis(ctx context.Context) (file.Path, error)
	// Gapir returns the path to the gapir binary in this layout.
	Gapir(ctx context.Context, abi *device.ABI) (file.Path, error)
	// GapidApk returns the path to gapid.apk in this layout.
	GapidApk(ctx context.Context, abi *device.ABI) (file.Path, error)
	// PerfettoCmd returns the path to the perfetto command-line tool
	PerfettoCmd(ctx context.Context, abi *device.ABI) (file.Path, error)
	// Library returns the path to the requested library.
	Library(ctx context.Context, lib LibraryType, abi *device.ABI) (file.Path, error)
	// Json returns the path to the Vulkan layer JSON definition for the given library.
	Json(ctx context.Context, lib LibraryType) (file.Path, error)
	// GoArgs returns additional arguments to pass to go binaries.
	GoArgs(ctx context.Context) []string
	// DeviceInfo returns the device info executable for the given ABI.
	DeviceInfo(ctx context.Context, os device.OSKind) (file.Path, error)
}

FileLayout provides a unified way of accessing various Gapid binaries.

func NewPkgLayout added in v1.1.0

func NewPkgLayout(dir file.Path, create bool) (FileLayout, error)

NewPkgLayout returns a FileLayout rooted at the given directory with the standard package layout. If create is true, the package layout is created if it doesn't exist, otherwise an error is returned.

func RunfilesLayout added in v1.1.0

func RunfilesLayout(manifest file.Path) (FileLayout, error)

RunfilesLayout creates a new layout based on the given runfiles manifest.

type LibraryType

type LibraryType int

LibraryType enumerates the possible GAPID dynamic libraries.

const (
	LibGraphicsSpy LibraryType = iota
	LibVirtualSwapChain
)

type ZipLayout added in v1.1.0

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

ZipLayout is a FileLayout view over a ZIP file.

func NewZipLayout added in v1.1.0

func NewZipLayout(f *zip.Reader, os device.OSKind) *ZipLayout

NewZipLayout returns a new ZipLayout using the given ZIP file.

func (*ZipLayout) DeviceInfo added in v1.2.0

func (l *ZipLayout) DeviceInfo(ctx context.Context, os device.OSKind) (*zip.File, error)

DeviceInfo returns the device info executable for the given ABI.

func (*ZipLayout) GapidApk added in v1.1.0

func (l *ZipLayout) GapidApk(ctx context.Context, abi *device.ABI) (*zip.File, error)

GapidApk returns the path to gapid.apk in this layout.

func (*ZipLayout) Gapir added in v1.1.0

func (l *ZipLayout) Gapir(ctx context.Context, abi *device.ABI) (*zip.File, error)

Gapir returns the path to the gapir binary in this layout.

func (*ZipLayout) Gapis added in v1.1.0

func (l *ZipLayout) Gapis(ctx context.Context) (*zip.File, error)

Gapis returns the path to the gapis binary in this layout.

func (*ZipLayout) Gapit added in v1.1.0

func (l *ZipLayout) Gapit(ctx context.Context) (*zip.File, error)

Gapit returns the path to the gapit binary in this layout.

func (*ZipLayout) Json added in v1.1.0

func (l *ZipLayout) Json(ctx context.Context, lib LibraryType) (*zip.File, error)

Json returns the path to the Vulkan layer JSON definition for the given library.

func (*ZipLayout) Library added in v1.1.0

func (l *ZipLayout) Library(ctx context.Context, lib LibraryType, abi *device.ABI) (*zip.File, error)

Library returns the path to the requested library.

func (*ZipLayout) PerfettoCmd added in v1.6.0

func (l *ZipLayout) PerfettoCmd(ctx context.Context, abi *device.ABI) (*zip.File, error)

PerfettoCmd returns the device info executable for the given ABI.

func (*ZipLayout) Strings added in v1.1.0

func (l *ZipLayout) Strings(ctx context.Context) (*zip.File, error)

Strings returns the path to the binary string table.

Jump to

Keyboard shortcuts

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