resolve

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: 42 Imported by: 22

Documentation

Overview

Package resolve exposes functions for performing complex data queries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIStateAfter added in v0.6.1

func APIStateAfter(c *path.Command, a api.ID) path.Node

APIStateAfter returns an absolute path to the API state after c.

func ArrayIndex

func ArrayIndex(ctx context.Context, p *path.ArrayIndex, r *path.ResolveConfig) (interface{}, error)

ArrayIndex resolves and returns the array or slice element from the path p.

func As

func As(ctx context.Context, p *path.As, r *path.ResolveConfig) (interface{}, error)

As resolves and returns the object at p transformed to the requested type.

func Blob

func Blob(ctx context.Context, p *path.Blob, r *path.ResolveConfig) ([]byte, error)

Blob resolves and returns the byte slice from the path p.

func Capture

Capture resolves and returns the capture from the path p.

func Cmd

Cmd resolves and returns the command from the path p.

func Cmds

func Cmds(ctx context.Context, p *path.Capture) ([]api.Cmd, error)

Cmds resolves and returns the command list from the path p.

func CommandThumbnail

func CommandThumbnail(
	ctx context.Context,
	w, h uint32,
	f *image.Format,
	noOpt bool,
	p *path.Command,
	r *path.ResolveConfig) (*image.Info, error)

CommandThumbnail resolves and returns the thumbnail for the framebuffer at p.

func CommandTree

CommandTree resolves the specified command tree path.

func CommandTreeNode

CommandTreeNode resolves the specified command tree node path.

func CommandTreeNodeForCommand

func CommandTreeNodeForCommand(ctx context.Context, p *path.CommandTreeNodeForCommand, r *path.ResolveConfig) (*path.CommandTreeNode, error)

CommandTreeNodeForCommand returns the path to the CommandTreeNode that represents the specified command.

func CommandTreeNodeThumbnail

func CommandTreeNodeThumbnail(
	ctx context.Context,
	w, h uint32,
	f *image.Format,
	noOpt bool,
	p *path.CommandTreeNode,
	r *path.ResolveConfig) (*image.Info, error)

CommandTreeNodeThumbnail resolves and returns the thumbnail for the framebuffer at p.

func Commands

Commands resolves and returns the command list from the path p.

func ConstantSet

ConstantSet resolves and returns the constant set from the path p.

func Context added in v0.6.1

Context resolves the single context.

func Contexts

func Contexts(ctx context.Context, p *path.Contexts, r *path.ResolveConfig) ([]*api.ContextInfo, error)

Contexts resolves the list of contexts belonging to a capture.

func ContextsByID added in v0.6.1

func ContextsByID(ctx context.Context, p *path.Contexts, r *path.ResolveConfig) (map[api.ContextID]*api.ContextInfo, error)

ContextsByID resolves the list of contexts belonging to a capture.

func Device

Device resolves and returns the device from the path p.

func DeviceTraceConfiguration added in v1.2.0

DeviceTraceConfiguration resolves and returns the trace config for a device.

func Events

Events resolves and returns the event list from the path p.

func Field

func Field(ctx context.Context, p *path.Field, r *path.ResolveConfig) (interface{}, error)

Field resolves and returns the field from the path p.

func Find

Find performs a search using req and calling handler for each result.

func Follow

func Follow(ctx context.Context, p *path.Any, r *path.ResolveConfig) (*path.Any, error)

Follow resolves the path to the object that the value at Path links to. If the value at Path does not link to anything then nil is returned.

func FramebufferAttachment

func FramebufferAttachment(
	ctx context.Context,
	replaySettings *service.ReplaySettings,
	after *path.Command,
	attachment api.FramebufferAttachment,
	settings *service.RenderSettings,
	hints *service.UsageHints,
	config *path.ResolveConfig,
) (*path.ImageInfo, error)

FramebufferAttachment resolves the specified framebuffer attachment at the specified point in a capture.

func FramebufferObservation added in v0.6.1

func FramebufferObservation(ctx context.Context, p *path.FramebufferObservation, r *path.ResolveConfig) (*image.Info, error)

FramebufferObservation returns the framebuffer observation for the given command.

func Get

func Get(ctx context.Context, p *path.Any, r *path.ResolveConfig) (interface{}, error)

Get resolves the object, value or memory at p.

func GlobalState

func GlobalState(ctx context.Context, p *path.GlobalState, r *path.ResolveConfig) (*api.GlobalState, error)

GlobalState resolves the global *api.GlobalState at a requested point in a capture.

func ImageInfo

func ImageInfo(ctx context.Context, p *path.ImageInfo, r *path.ResolveConfig) (*image.Info, error)

ImageInfo resolves and returns the ImageInfo from the path p.

func MapIndex

func MapIndex(ctx context.Context, p *path.MapIndex, r *path.ResolveConfig) (interface{}, error)

MapIndex resolves and returns the map value from the path p.

func Memory

func Memory(ctx context.Context, p *path.Memory, rc *path.ResolveConfig) (*service.Memory, error)

Memory resolves and returns the memory from the path p.

func Mesh

func Mesh(ctx context.Context, p *path.Mesh, r *path.ResolveConfig) (*api.Mesh, error)

Mesh resolves and returns the Mesh from the path p.

func Messages added in v1.2.0

func Messages(ctx context.Context, p *path.Messages) (interface{}, error)

func Metrics added in v1.2.0

func Metrics(ctx context.Context, p *path.Metrics, r *path.ResolveConfig) (*api.Metrics, error)

func NCmds

func NCmds(ctx context.Context, p *path.Capture, n uint64) ([]api.Cmd, error)

NCmds resolves and returns the command list from the path p, ensuring that the number of commands is at least N.

func Parameter

func Parameter(ctx context.Context, p *path.Parameter, r *path.ResolveConfig) (interface{}, error)

Parameter resolves and returns the parameter from the path p.

func Report

Report resolves the report for the given path.

func ResolveInternal

func ResolveInternal(ctx context.Context, p path.Node, r *path.ResolveConfig) (interface{}, error)

ResolveInternal resolves and returns the object, value or memory at the path p without converting the potentially internal result to a service representation.

func ResolveService

func ResolveService(ctx context.Context, p path.Node, r *path.ResolveConfig) (interface{}, error)

ResolveService resolves and returns the object, value or memory at the path p, converting the final result to the service representation.

func ResourceData

func ResourceData(ctx context.Context, p *path.ResourceData, r *path.ResolveConfig) (interface{}, error)

ResourceData resolves the data of the specified resource at the specified point in the capture.

func ResourceDataThumbnail

func ResourceDataThumbnail(ctx context.Context, w, h uint32, f *image.Format, p *path.ResourceData, r *path.ResolveConfig) (*image.Info, error)

ResourceDataThumbnail resolves and returns the thumbnail for the resource at p.

func ResourceMeta

func ResourceMeta(ctx context.Context, ids []*path.ID, after *path.Command, r *path.ResolveConfig) (*api.ResourceMeta, error)

ResourceMeta returns the metadata for the specified resource.

func Resources

func Resources(ctx context.Context, c *path.Capture, r *path.ResolveConfig) (*service.Resources, error)

Resources resolves all the resources used by the specified capture.

func Result

func Result(ctx context.Context, p *path.Result, r *path.ResolveConfig) (interface{}, error)

Result resolves and returns the command's result from the path p.

func Set

func Set(ctx context.Context, p *path.Any, v interface{}, r *path.ResolveConfig) (*path.Any, error)

Set creates a copy of the capture referenced by the request's path, but with the object, value or memory at p replaced with v. The path returned is identical to p, but with the base changed to refer to the new capture.

func SetupContext added in v1.2.1

func SetupContext(ctx context.Context, c *path.Capture, r *path.ResolveConfig) context.Context

SetupContext binds the capture and a replay device to the returned context.

func Slice

func Slice(ctx context.Context, p *path.Slice, r *path.ResolveConfig) (interface{}, error)

Slice resolves and returns the subslice from the path p.

func State added in v0.6.1

func State(ctx context.Context, p *path.State, r *path.ResolveConfig) (interface{}, error)

State resolves the specific API state at a requested point in a capture.

func StateTree

StateTree resolves the specified state tree path.

func StateTreeNode

StateTreeNode resolves the specified command tree node path.

func StateTreeNodeForPath

func StateTreeNodeForPath(ctx context.Context, p *path.StateTreeNodeForPath, r *path.ResolveConfig) (*path.StateTreeNode, error)

StateTreeNodeForPath returns the path to the StateTreeNode representing the path p.

func Stats added in v1.2.0

func Stats(ctx context.Context, p *path.Stats, r *path.ResolveConfig) (*service.Stats, error)

Stats resolves and returns the stats list from the path p.

func SyncData added in v0.6.0

func SyncData(ctx context.Context, p *path.Capture) (*sync.Data, error)

SyncData resolves and returns the sync.Data from the path p.

func Thumbnail

func Thumbnail(ctx context.Context, p *path.Thumbnail, r *path.ResolveConfig) (*image.Info, error)

Thumbnail resolves and returns the thumbnail from the path p.

Types

type AttachmentFramebufferChanges

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

AttachmentFramebufferChanges describes the list of attachment changes over the span of the entire capture.

func FramebufferChanges

func FramebufferChanges(ctx context.Context, c *path.Capture, r *path.ResolveConfig) (*AttachmentFramebufferChanges, error)

FramebufferChanges returns the list of attachment changes over the span of the entire capture.

func (AttachmentFramebufferChanges) Get added in v1.1.0

Get returns the framebuffer dimensions and format after a given command in the given capture, command and attachment.

type CmdGroupData added in v0.6.1

type CmdGroupData struct {
	Representation api.CmdID
	// If true, then children frame event groups should not be added to this group.
	NoFrameEventGroups bool
}

CmdGroupData is the additional metadata assigned to api.CmdIDGroups UserData field.

type CommandFilter added in v0.9.0

type CommandFilter func(api.CmdID, api.Cmd, *api.GlobalState) bool

CommandFilter is a predicate used for filtering commands. If the function returns true then the command is considered, otherwise it is ignored.

type CommandFilters added in v0.9.0

type CommandFilters []CommandFilter

CommandFilters is a list of CommandFilters.

func (CommandFilters) All added in v0.9.0

func (l CommandFilters) All(id api.CmdID, cmd api.Cmd, s *api.GlobalState) bool

All is a CommandFilter that needs all the contained filters to pass.

type FramebufferAttachmentInfo

type FramebufferAttachmentInfo struct {
	// After is the index of the last command to change the attachment.
	After api.SubCmdIdx

	// Width of the framebuffer attachment in pixels.
	Width uint32

	// Height of the framebuffer attachment in pixels.
	Height uint32

	// Can this image be resized in the server
	CanResize bool

	// Index of the api-specific attachment.
	Index uint32

	// Format of the attachment.
	Format *image.Format

	// The error returned by the API. If this is non-null then all other fields
	// may contain undefined values.
	Err error
}

FramebufferAttachmentInfo describes the dimensions and format of a framebuffer attachment.

type Importance added in v0.6.1

type Importance interface {
	Importance() int
}

Importance is the interface implemeneted by commands that provide an "importance score". This value is used to prioritize contexts.

type IndexRange

type IndexRange struct {
	First uint32
	Count uint32
}

IndexRange represents the range of indices which were referenced by index buffer.

func IndexLimits

func IndexLimits(ctx context.Context, data id.ID, count int, size int, littleEndian bool) (*IndexRange, error)

IndexLimits returns the range of indices which were referenced by index buffer with identifier id. The buffer holds count elements, each of size bytes.

type Named added in v0.6.1

type Named interface {
	Name() string
}

Named is the interface implemented by context that have a name.

type ResolvedResources

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

ResolvedResources contains all of the resolved resources for a particular point in the trace.

Directories

Path Synopsis
Package cmdgrouper provides types for grouping together commands.
Package cmdgrouper provides types for grouping together commands.

Jump to

Keyboard shortcuts

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