MCPcopy Create free account
hub / github.com/google/pprof / UI

Interface UI

internal/plugin/plugin.go:178–204  ·  view source on GitHub ↗

A UI manages user interactions.

Source from the content-addressed store, hash-verified

176
177// A UI manages user interactions.
178type UI interface {
179 // ReadLine returns a line of text (a command) read from the user.
180 // prompt is printed before reading the command.
181 ReadLine(prompt string) (string, error)
182
183 // Print shows a message to the user.
184 // It formats the text as fmt.Print would and adds a final \n if not already present.
185 // For line-based UI, Print writes to standard error.
186 // (Standard output is reserved for report data.)
187 Print(...interface{})
188
189 // PrintErr shows an error message to the user.
190 // It formats the text as fmt.Print would and adds a final \n if not already present.
191 // For line-based UI, PrintErr writes to standard error.
192 PrintErr(...interface{})
193
194 // IsTerminal returns whether the UI is known to be tied to an
195 // interactive terminal (as opposed to being redirected to a file).
196 IsTerminal() bool
197
198 // WantBrowser indicates whether a browser should be opened with the -http option.
199 WantBrowser() bool
200
201 // SetAutoComplete instructs the UI to call complete(cmd) to obtain
202 // the auto-completion of cmd, if the UI supports auto-completion at all.
203 SetAutoComplete(complete func(string) string)
204}
205
206// HTTPServerArgs contains arguments needed by an HTTP server that
207// is exporting a pprof web interface.

Callers

nothing calls this directly

Implementers 4

readlineUIpprof.go
TestUIinternal/proftest/proftest.go
stdUIinternal/driver/options.go
testUIbrowsertests/testutils.go

Calls

no outgoing calls

Tested by

no test coverage detected