controller

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

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

View Source
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(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

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(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

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.

Jump to

Keyboard shortcuts

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