Back to godoc.org

Package controller

v0.34.0
Latest Go to latest

The latest major version is .

Published: Dec 5, 2018 | License: Apache-2.0 | Module: gitee.com/arohat/google-cloud-go

Overview

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

Index

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

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

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

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.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier