Documentation ¶
Overview ¶
Package rest provides RESTful HTTP client and server implementations.
Index ¶
- type ClientError
- type Config
- type RESTClient
- func (c *RESTClient) ClearBreakPoint(id int) (*api.BreakPoint, error)
- func (c *RESTClient) Continue() (*api.DebuggerState, error)
- func (c *RESTClient) CreateBreakPoint(breakPoint *api.BreakPoint) (*api.BreakPoint, error)
- func (c *RESTClient) Detach(killProcess bool) error
- func (c *RESTClient) EvalSymbol(symbol string) (*api.Variable, error)
- func (c *RESTClient) EvalSymbolFor(threadID int, symbol string) (*api.Variable, error)
- func (c *RESTClient) GetBreakPoint(id int) (*api.BreakPoint, error)
- func (c *RESTClient) GetState() (*api.DebuggerState, error)
- func (c *RESTClient) GetThread(id int) (*api.Thread, error)
- func (c *RESTClient) Halt() (*api.DebuggerState, error)
- func (c *RESTClient) ListBreakPoints() ([]*api.BreakPoint, error)
- func (c *RESTClient) ListFunctions(filter string) ([]string, error)
- func (c *RESTClient) ListGoroutines() ([]*api.Goroutine, error)
- func (c *RESTClient) ListPackageVariables(filter string) ([]api.Variable, error)
- func (c *RESTClient) ListPackageVariablesFor(threadID int, filter string) ([]api.Variable, error)
- func (c *RESTClient) ListSources(filter string) ([]string, error)
- func (c *RESTClient) ListThreads() ([]*api.Thread, error)
- func (c *RESTClient) Next() (*api.DebuggerState, error)
- func (c *RESTClient) Step() (*api.DebuggerState, error)
- func (c *RESTClient) SwitchThread(threadID int) (*api.DebuggerState, error)
- type RESTServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientError ¶
type ClientError struct { // Message is the specific error from the debugger. Message string // Status is the HTTP error from the debugger request. Status string }
ClientError is an error from the debugger.
func (*ClientError) Error ¶
func (e *ClientError) Error() string
type Config ¶
type Config struct { // Listener is used to serve HTTP. Listener net.Listener // ProcessArgs are the arguments to launch a new process. ProcessArgs []string // AttachPid is the PID of an existing process to which the debugger should // attach. AttachPid int }
Config provides the configuration to start a Debugger and expose it with a RESTServer.
Only one of ProcessArgs or AttachPid should be specified. If ProcessArgs is provided, a new process will be launched. Otherwise, the debugger will try to attach to an existing process with AttachPid.
type RESTClient ¶
type RESTClient struct {
// contains filtered or unexported fields
}
Client is a REST service.Client.
func (*RESTClient) ClearBreakPoint ¶
func (c *RESTClient) ClearBreakPoint(id int) (*api.BreakPoint, error)
func (*RESTClient) Continue ¶
func (c *RESTClient) Continue() (*api.DebuggerState, error)
func (*RESTClient) CreateBreakPoint ¶
func (c *RESTClient) CreateBreakPoint(breakPoint *api.BreakPoint) (*api.BreakPoint, error)
func (*RESTClient) Detach ¶
func (c *RESTClient) Detach(killProcess bool) error
func (*RESTClient) EvalSymbol ¶
func (c *RESTClient) EvalSymbol(symbol string) (*api.Variable, error)
func (*RESTClient) EvalSymbolFor ¶
func (*RESTClient) GetBreakPoint ¶
func (c *RESTClient) GetBreakPoint(id int) (*api.BreakPoint, error)
func (*RESTClient) GetState ¶
func (c *RESTClient) GetState() (*api.DebuggerState, error)
func (*RESTClient) Halt ¶
func (c *RESTClient) Halt() (*api.DebuggerState, error)
func (*RESTClient) ListBreakPoints ¶
func (c *RESTClient) ListBreakPoints() ([]*api.BreakPoint, error)
func (*RESTClient) ListFunctions ¶
func (c *RESTClient) ListFunctions(filter string) ([]string, error)
func (*RESTClient) ListGoroutines ¶
func (c *RESTClient) ListGoroutines() ([]*api.Goroutine, error)
func (*RESTClient) ListPackageVariables ¶
func (c *RESTClient) ListPackageVariables(filter string) ([]api.Variable, error)
func (*RESTClient) ListPackageVariablesFor ¶
func (*RESTClient) ListSources ¶
func (c *RESTClient) ListSources(filter string) ([]string, error)
func (*RESTClient) ListThreads ¶
func (c *RESTClient) ListThreads() ([]*api.Thread, error)
func (*RESTClient) Next ¶
func (c *RESTClient) Next() (*api.DebuggerState, error)
func (*RESTClient) Step ¶
func (c *RESTClient) Step() (*api.DebuggerState, error)
func (*RESTClient) SwitchThread ¶
func (c *RESTClient) SwitchThread(threadID int) (*api.DebuggerState, error)
type RESTServer ¶
type RESTServer struct {
// contains filtered or unexported fields
}
RESTServer exposes a Debugger via a HTTP REST API.
func (*RESTServer) Run ¶
func (s *RESTServer) Run() error
Run starts a debugger and exposes it with an HTTP server. The debugger itself can be stopped with the `detach` API. Run blocks until the HTTP server stops.
func (*RESTServer) Stop ¶
func (s *RESTServer) Stop(kill bool) error
Stop detaches from the debugger and waits for it to stop.