go: cloud.google.com/go/cmd/go-cloud-debug-agent/internal/controller Index | Files

package controller

import "cloud.google.com/go/cmd/go-cloud-debug-agent/internal/controller"

Package controller is a library for interacting with the Google Cloud Debugger's Debuglet Controller service.


Package Files



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")

type Controller Uses

type Controller struct {
    // contains filtered or unexported fields

Controller manages a connection to the Debuglet Controller service.

func NewController Uses

func NewController(ctx context.Context, 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 Uses

func (c *Controller) List(ctx context.Context) (*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 Uses

func (c *Controller) Update(ctx context.Context, 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 Uses

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
    TokenSource    oauth2.TokenSource // Source of Credentials used for Stackdriver Debugger.

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.

Package controller imports 12 packages (graph) and is imported by 2 packages. Updated 2018-06-20. Refresh now. Tools for package owners.