controls

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2015 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewPipe = func(c PipeClient, appID string) (string, xfer.Pipe, error) {
	pipeID := fmt.Sprintf("pipe-%d", rand.Int63())
	pipe := &pipe{
		Pipe:   xfer.NewPipe(),
		appID:  appID,
		id:     pipeID,
		client: c,
	}
	if err := c.PipeConnection(appID, pipeID, pipe.Pipe); err != nil {
		return "", nil, err
	}
	return pipeID, pipe, nil
}

NewPipe creats a new pipe and connects it to the app.

Functions

func HandleControlRequest

func HandleControlRequest(req xfer.Request) xfer.Response

HandleControlRequest performs a control request.

func Register

func Register(control string, f xfer.ControlHandlerFunc)

Register a new control handler under a given id.

func Rm

func Rm(control string)

Rm deletes the handler for a given name

Types

type PipeClient added in v0.11.0

type PipeClient interface {
	PipeConnection(string, string, xfer.Pipe) error
	PipeClose(string, string) error
}

PipeClient is the type of the thing the probe uses to make pipe connections.

Jump to

Keyboard shortcuts

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