wilcoextension

package
v0.0.0-...-683b059 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package wilcoextension contains constants and helpers to work with the extension that can interact with the Wilco DTC VM. TODO(b/189457904): remove once wilco.APISendMessageToUIEnrolled and wilco.APIHandleMessageFromUIEnrolled will be stable enough.

Index

Constants

View Source
const ID = "emelalhagcpibaiiiijjlkmhhbekaidg"

ID is hardcoded in Chrome to have access to the private API.

View Source
const Manifest = `` /* 677-byte string literal not displayed */

Manifest gives the extension permissions necessary to access the private API.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuiltInMessaging

type BuiltInMessaging struct {
	// contains filtered or unexported fields
}

BuiltInMessaging is a helper to interact with the Wilco built-in messaging API

func NewBuiltInMessaging

func NewBuiltInMessaging(ctx context.Context, pc ps.PolicyServiceClient) (*BuiltInMessaging, error)

NewBuiltInMessaging creates a new instance of BuiltInMessaging and connects to the built-in API.

func (*BuiltInMessaging) AddReply

func (n *BuiltInMessaging) AddReply(ctx context.Context, message interface{}) error

AddReply sets message as the reply to the next message. Multiple replies can be queued.

func (*BuiltInMessaging) GetMessage

func (n *BuiltInMessaging) GetMessage(ctx context.Context, message interface{}) error

GetMessage reads a messasge the built-in messaging port.

func (*BuiltInMessaging) SendMessage

func (n *BuiltInMessaging) SendMessage(ctx context.Context, message interface{}) error

SendMessage sends a message over the built-in messaging port.

func (*BuiltInMessaging) SendMessageAndGetReply

func (n *BuiltInMessaging) SendMessageAndGetReply(ctx context.Context, message, response interface{}) error

SendMessageAndGetReply sends a message over the built-in messaging port. It waits for the response to arrive and saves it in the response parameter.

func (*BuiltInMessaging) StartListener

func (n *BuiltInMessaging) StartListener(ctx context.Context) error

StartListener starts receiving messages from the built-in messaging port.

func (*BuiltInMessaging) WaitForMessage

func (n *BuiltInMessaging) WaitForMessage(ctx context.Context, message interface{}) error

WaitForMessage reads a messasge the built-in messaging port and waits if none are available.

Jump to

Keyboard shortcuts

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