appmap

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: Apache-2.0 Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	SameScreen     = 0.80
	ExpectedScreen = 0.55
	PartOfScreen   = 0.70
)
View Source
const (
	KindScreen   = "screen"
	KindOverlay  = "overlay"
	KindState    = "state"
	KindExternal = "external"
)
View Source
const (
	StatusPending   = "pending"
	StatusDone      = "done"
	StatusFailed    = "failed"
	StatusDenied    = "denied"
	StatusInput     = "input"
	StatusFilled    = "filled"
	StatusDisabled  = "disabled"
	StatusSampled   = "sampled"
	StatusInherited = "inherited"
	StatusNoTarget  = "no-selector"
)
View Source
const Version = 1

Variables

View Source
var DefaultDeny = regexp.MustCompile(`(?i)^\W*(` + denyWords + `)\b`)

Functions

func DefaultPath

func DefaultPath(dir, app, platform string) string

func Headings

func Headings(l *look.Listing, only map[int]bool) []string

func Title

func Title(l *look.Listing, only map[int]bool) string

Types

type Action

type Action struct {
	Label    string   `json:"label"`
	Kind     string   `json:"kind"`
	Selector string   `json:"selector"`
	Feature  string   `json:"feature,omitempty"`
	Reach    []string `json:"reach,omitempty"`
	Status   string   `json:"status"`
	To       string   `json:"to,omitempty"`
	Note     string   `json:"note,omitempty"`
	Group    string   `json:"group,omitempty"`
	Field    bool     `json:"field,omitempty"`
	Hint     string   `json:"hint,omitempty"`
	ID       string   `json:"id,omitempty"`
}

type Ambiguous

type Ambiguous struct {
	Query   string
	Hits    []Hit
	Screens []*Screen
}

func (*Ambiguous) Candidates

func (a *Ambiguous) Candidates() []*Screen

func (*Ambiguous) Error

func (a *Ambiguous) Error() string

type CheckLine

type CheckLine struct {
	From   string `json:"from"`
	Action string `json:"action"`
	Want   string `json:"want"`
	Got    string `json:"got,omitempty"`
	Result string `json:"result"`
	Error  string `json:"error,omitempty"`
}

type CheckReport

type CheckReport struct {
	OK          int         `json:"ok"`
	Changed     int         `json:"changed"`
	Failed      int         `json:"failed"`
	Unreachable int         `json:"unreachable"`
	Lines       []CheckLine `json:"lines"`
	Stopped     string      `json:"stopped,omitempty"`
}

func (*CheckReport) Passed

func (r *CheckReport) Passed() bool

func (*CheckReport) Text

func (r *CheckReport) Text() string

type Coverage

type Coverage struct {
	Screens    int      `json:"screens"`
	Covered    int      `json:"covered"`
	Edges      int      `json:"edges"`
	EdgesHit   int      `json:"edgesCovered"`
	Missing    []string `json:"missing"`
	Unresolved int      `json:"unresolved"`
	Taps       int      `json:"taps"`
}

func (*Coverage) Text

func (c *Coverage) Text() string

type Crawler

type Crawler struct {
	Map *Map
	Dev Device
	Opt Options
	// contains filtered or unexported fields
}

func NewCrawler

func NewCrawler(m *Map, dev Device, opt Options) *Crawler

func (*Crawler) Check

func (c *Crawler) Check(ctx context.Context) *CheckReport

func (*Crawler) Crawl

func (c *Crawler) Crawl(ctx context.Context) error

func (*Crawler) GoTo

func (c *Crawler) GoTo(ctx context.Context, s *Screen) error

func (*Crawler) Stopped

func (c *Crawler) Stopped() string

type Device

type Device interface {
	Read(ctx context.Context) (*look.Listing, error)
	Run(ctx context.Context, steps []string) error
}

type DiffReport

type DiffReport struct {
	Added   []string       `json:"added"`
	Removed []string       `json:"removed"`
	Changed []ScreenChange `json:"changed"`
}

func Diff

func Diff(old, new *Map) *DiffReport

func (*DiffReport) Empty

func (d *DiffReport) Empty() bool

func (*DiffReport) Text

func (d *DiffReport) Text() string

type Edge

type Edge struct {
	From  string    `json:"from"`
	To    string    `json:"to"`
	Steps []string  `json:"steps"`
	Label string    `json:"label"`
	Kind  string    `json:"kind"`
	Seen  time.Time `json:"seen"`
}

type Element

type Element struct {
	Kind     string `json:"kind"`
	Label    string `json:"label,omitempty"`
	ID       string `json:"id,omitempty"`
	Hint     string `json:"hint,omitempty"`
	Selector string `json:"selector,omitempty"`
	Check    string `json:"check,omitempty"`
	Feature  string `json:"feature,omitempty"`
	Tappable bool   `json:"tappable,omitempty"`
	Field    bool   `json:"field,omitempty"`
	Top      int    `json:"top"`
}

type FlowStep

type FlowStep struct {
	Text   string
	Assert bool
}

type Hit

type Hit struct {
	Screen *Screen `json:"-"`
	ID     string  `json:"id"`
	Name   string  `json:"name"`
	Score  float64 `json:"score"`
	Why    string  `json:"why"`
}

type InputRule

type InputRule struct {
	Match *regexp.Regexp
	Value string
}

type Inputs

type Inputs struct {
	Rules []InputRule
}

func AutoInputs

func AutoInputs() *Inputs

func LoadInputs

func LoadInputs(path string) (*Inputs, error)

func (*Inputs) For

func (in *Inputs) For(a *Action) (string, bool)

type Map

type Map struct {
	Version  int       `json:"version"`
	App      string    `json:"app"`
	Platform string    `json:"platform"`
	Created  time.Time `json:"created"`
	Updated  time.Time `json:"updated"`
	Start    []string  `json:"start"`
	Screens  []*Screen `json:"screens"`
	Edges    []*Edge   `json:"edges"`
	Stats    Stats     `json:"stats"`

	Hide *strings.Replacer `json:"-"`
	// contains filtered or unexported fields
}

func Load

func Load(path string) (*Map, error)

func New

func New(app, platform string, start []string) *Map

func (*Map) AddAliases

func (m *Map) AddAliases(s *Screen, names []string) ([]string, error)

func (*Map) Anchors

func (m *Map) Anchors()

func (*Map) Cover

func (m *Map) Cover(flows []*flow.Flow) *Coverage

func (*Map) Detail

func (m *Map) Detail(s *Screen) string

func (*Map) EdgesFrom

func (m *Map) EdgesFrom(id string) []*Edge

func (*Map) Find

func (m *Map) Find(query string) []Hit

func (*Map) FindAction

func (m *Map) FindAction(s *Screen, query string) (*Action, error)

func (*Map) Finish

func (m *Map) Finish()

func (*Map) Flow

func (m *Map) Flow(name string, edges []*Edge) string

func (*Map) FromLaunch

func (m *Map) FromLaunch(to *Screen) ([]*Edge, error)

func (*Map) HTML

func (m *Map) HTML() string

func (*Map) Headline

func (m *Map) Headline() string

func (*Map) KeepNames

func (m *Map) KeepNames(old *Map, skip map[string]bool)

func (*Map) Locate

func (m *Map) Locate(l *look.Listing) Match

func (*Map) Match

func (m *Map) Match(v *View) Match

func (*Map) Rename

func (m *Map) Rename()

func (*Map) Resolve

func (m *Map) Resolve(query string) (*Screen, error)

func (*Map) Root

func (m *Map) Root() *Screen

func (*Map) Route

func (m *Map) Route(from, to *Screen) ([]*Edge, error)

func (*Map) Save

func (m *Map) Save(path string) error

func (*Map) Score

func (m *Map) Score(s *Screen, features []string) float64

func (*Map) ScoreView

func (m *Map) ScoreView(s *Screen, v *View) float64

func (*Map) Screen

func (m *Map) Screen(id string) *Screen

func (*Map) Steps

func (m *Map) Steps(edges []*Edge) []FlowStep

func (*Map) Summary

func (m *Map) Summary(edges bool) string

func (*Map) TakeGivenNames

func (m *Map) TakeGivenNames(disk *Map)

func (*Map) Where

func (m *Map) Where(l *look.Listing) Place

type Match

type Match struct {
	Screen *Screen
	Score  float64
	Next   *Screen
	NextAt float64
}

type Names

type Names struct {
	Display  string   `json:"display"`
	Title    string   `json:"title,omitempty"`
	Headings []string `json:"headings,omitempty"`
	Via      string   `json:"via,omitempty"`
	Route    string   `json:"route,omitempty"`
	Given    []string `json:"given,omitempty"`
	Aliases  []string `json:"aliases,omitempty"`
}

func (Names) All

func (n Names) All() []string

type Options

type Options struct {
	MaxDepth   int
	MaxScreens int
	MaxActions int
	MaxScrolls int
	MaxStates  int
	Sample     int
	Deadline   time.Time
	Deny       *regexp.Regexp
	Allow      *regexp.Regexp
	Inputs     *Inputs
	Back       bool
	TapTimeout int
	Progress   func(string)
	Checkpoint func(*Map)
	Shot       func(*Screen)
	Sleep      func(context.Context, time.Duration)
}

type Place

type Place struct {
	Screen string  `json:"screen,omitempty"`
	ID     string  `json:"id,omitempty"`
	Score  float64 `json:"score"`
	Known  bool    `json:"known"`
	Next   string  `json:"next,omitempty"`
	NextAt float64 `json:"nextScore,omitempty"`
}

func (Place) Text

func (p Place) Text() string

type Screen

type Screen struct {
	ID           string    `json:"id"`
	Kind         string    `json:"kind"`
	Parent       string    `json:"parent,omitempty"`
	Names        Names     `json:"names"`
	Route        string    `json:"route,omitempty"`
	Heading      string    `json:"heading,omitempty"`
	TitleMatters bool      `json:"titleMatters,omitempty"`
	TitleVaries  bool      `json:"titleVaries,omitempty"`
	Core         []string  `json:"core"`
	Extra        []string  `json:"extra,omitempty"`
	Anchor       string    `json:"anchor,omitempty"`
	AnchorWeak   bool      `json:"anchorWeak,omitempty"`
	Path         []string  `json:"path"`
	Depth        int       `json:"depth"`
	Elements     []Element `json:"elements"`
	Actions      []*Action `json:"actions"`
	Listing      string    `json:"listing"`
	Scrolled     bool      `json:"scrolled,omitempty"`
	Unreachable  string    `json:"unreachable,omitempty"`
	Shot         string    `json:"shot,omitempty"`
}

func (*Screen) Pending

func (s *Screen) Pending() int

func (*Screen) RemoveAliases

func (s *Screen) RemoveAliases(names []string) []string

type ScreenChange

type ScreenChange struct {
	Screen  string   `json:"screen"`
	Added   []string `json:"added,omitempty"`
	Removed []string `json:"removed,omitempty"`
	Moved   []string `json:"moved,omitempty"`
}

type Stats

type Stats struct {
	Actions  int     `json:"actions"`
	Restores int     `json:"restores"`
	Failed   int     `json:"failed"`
	Seconds  float64 `json:"seconds"`
}

type View

type View struct {
	Features []string
	ByRef    map[int]string
	Group    map[int]string
	Title    string
	Headings []string
	Route    string
	Modal    bool
}

func Extract

func Extract(l *look.Listing) *View

Jump to

Keyboard shortcuts

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