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
- type BuiltInMessaging
- func (n *BuiltInMessaging) AddReply(ctx context.Context, message interface{}) error
- func (n *BuiltInMessaging) GetMessage(ctx context.Context, message interface{}) error
- func (n *BuiltInMessaging) SendMessage(ctx context.Context, message interface{}) error
- func (n *BuiltInMessaging) SendMessageAndGetReply(ctx context.Context, message, response interface{}) error
- func (n *BuiltInMessaging) StartListener(ctx context.Context) error
- func (n *BuiltInMessaging) WaitForMessage(ctx context.Context, message interface{}) error
Constants ¶
const ID = "emelalhagcpibaiiiijjlkmhhbekaidg"
ID is hardcoded in Chrome to have access to the private API.
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.