Documentation ¶
Overview ¶
Package controller is a library for interacting with the Google Cloud Debugger's Debuglet Controller service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrListUnchanged is returned by List if the server time limit is reached // before the list of breakpoints changes. ErrListUnchanged = errors.New("breakpoint list unchanged") // ErrDebuggeeDisabled is returned by List or Update if the server has disabled // this Debuggee. The caller can retry later. ErrDebuggeeDisabled = errors.New("debuglet disabled by server") )
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller manages a connection to the Debuglet Controller service.
func NewController ¶
func NewController(o Options) (*Controller, error)
NewController connects to the Debuglet Controller server using the given options, and returns a Controller for that connection. Google Application Default Credentials are used to connect to the Debuglet Controller; see https://developers.google.com/identity/protocols/application-default-credentials
func (*Controller) List ¶
func (c *Controller) List() (*cd.ListActiveBreakpointsResponse, error)
List retrieves the current list of breakpoints from the server. If the set of breakpoints on the server is the same as the one returned in the previous call to List, the server can delay responding until it changes, and return an error instead if no change occurs before a time limit the server sets. List can't be called concurrently with itself.
func (*Controller) Update ¶
func (c *Controller) Update(breakpointID string, bp *cd.Breakpoint) error
Update reports information to the server about a breakpoint that was hit. Update can be called concurrently with List and Update.
type Options ¶
type Options struct { ProjectNumber string // GCP Project Number. ProjectID string // GCP Project ID. AppModule string // Module name for the debugged program. AppVersion string // Version number for this module. SourceContexts []*cd.SourceContext // Description of source. Verbose bool ServiceAccountFile string // File containing service account credentials. }
Options controls how the Debuglet Controller client identifies itself to the server. See https://cloud.google.com/storage/docs/projects and https://cloud.google.com/tools/cloud-debugger/setting-up-on-compute-engine for further documentation of these parameters.