agentport

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Rendered for js/wasm

Overview

Package agentport supports serving the SSH Agent protocol to Chrome's Secure Shell Extension.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentPort added in v0.0.20

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

func New

func New(p js.Value) *AgentPort

New returns a io.ReaderWriter that converts from the Chrome Secure Shell Extension's SSH Agent protocol to the standard SSH Agent protocol.

p is a Chrome Port object to which the Chrome Secure Shell Extension has connected.

func (*AgentPort) OnDisconnect added in v0.0.20

func (ap *AgentPort) OnDisconnect()

func (*AgentPort) OnMessage added in v0.0.20

func (ap *AgentPort) OnMessage(msg js.Value)

func (*AgentPort) Read added in v0.0.20

func (ap *AgentPort) Read(p []byte) (n int, err error)

func (*AgentPort) SendMessages added in v0.0.20

func (ap *AgentPort) SendMessages()

func (*AgentPort) Write added in v0.0.20

func (ap *AgentPort) Write(p []byte) (n int, err error)

type AgentPorts added in v0.0.20

type AgentPorts map[*portRef]*AgentPort

AgentPorts is a mapping of chrome.runtime.Port objects to the corresponding connection (AgentPort) with our Agent.

func (AgentPorts) Add added in v0.0.20

func (a AgentPorts) Add(port js.Value, ap *AgentPort)

Add adds an AgentPort corresponding to the supplied Port.

func (AgentPorts) Delete added in v0.0.20

func (a AgentPorts) Delete(port js.Value)

Delete removes the AgentPort corresponding to the supplied Port.

func (AgentPorts) Lookup added in v0.0.20

func (a AgentPorts) Lookup(port js.Value) *AgentPort

Lookup returns the AgentPort corresponding to the supplied Port value. A Port value is considered equal if it refers to the exact same Port as was originally supplied. This works because the Chrome runtime appears to maintain a unique Port value for each port, and just pass around a reference to it. Thus, we use js.Value.Equal() to compare ports; two references to the same object are equal iff they are equal in the '===' sense in Javascript.

Jump to

Keyboard shortcuts

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