Help us shape the future of Go! Take the 2026 Go Developer Survey

bridge

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package bridge owns connectivity authority, never agent execution or sessions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParsePeerID

func ParsePeerID(id string) (ed25519.PublicKey, error)

func PeerID

func PeerID(key ed25519.PublicKey) string

Types

type Bridge

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

func Open

func Open(store connect.Store, create bool) (*Bridge, error)

func (*Bridge) AddGrant

func (b *Bridge) AddGrant(g Grant) error

func (*Bridge) Admin

func (b *Bridge) Admin(_ context.Context, method string, params json.RawMessage) (json.RawMessage, error)

Admin is deliberately absent from the remote routing table. Hosts expose it only after local-owner authentication.

func (*Bridge) Allowed

func (b *Bridge) Allowed(p connect.Principal, id, permission string) bool

func (*Bridge) Approve

func (b *Bridge) Approve(id, claimant string) error

func (*Bridge) Attach

func (b *Bridge) Attach(id, credential, boot string, endpoint connect.Endpoint) (string, error)

func (*Bridge) Authorize

func (b *Bridge) Authorize(r connect.Request) bool

func (*Bridge) Available

func (b *Bridge) Available(id string) bool

func (*Bridge) Block

func (b *Bridge) Block(peer string) error

func (*Bridge) Call

func (*Bridge) Catalog

func (b *Bridge) Catalog(p connect.Principal) []Instance

func (*Bridge) Changes

func (b *Bridge) Changes() <-chan struct{}

func (*Bridge) Claim

func (b *Bridge) Claim(peer, id, token string, locators ...string) (Invitation, error)

func (*Bridge) Close

func (b *Bridge) Close() error

func (*Bridge) Connect

func (b *Bridge) Connect(ctx context.Context, stream net.Conn, expected string, server bool) (*protocol.Conn, string, error)

Connect authenticates a caller-supplied stream. It never creates a listener, locates a profile, or starts an agent runtime.

func (*Bridge) Connection

func (b *Bridge) Connection(peer string) *protocol.Conn

Connection returns an existing authenticated channel in either direction.

func (*Bridge) Contacts

func (b *Bridge) Contacts(peer, scope string) ([]Record, error)

func (*Bridge) Detach

func (b *Bridge) Detach(id, generation string)

func (*Bridge) Enroll

func (b *Bridge) Enroll(alias, group string) (Instance, string, error)

func (*Bridge) Handle

func (b *Bridge) Handle(ctx context.Context, peer, method string, params json.RawMessage) (json.RawMessage, error)

func (*Bridge) Hello

func (b *Bridge) Hello() Hello

func (*Bridge) Invite

func (b *Bridge) Invite(grants []Grant) (Invitation, error)

func (*Bridge) MergeContact

func (b *Bridge) MergeContact(sender string, r Record) (bool, error)

func (*Bridge) Outbound

func (b *Bridge) Outbound(instance, peer string, call connect.Call) (connect.Subject, error)

func (*Bridge) PairStatus

func (b *Bridge) PairStatus(peer, id string) (Invitation, error)

func (*Bridge) PeerID

func (b *Bridge) PeerID() string

func (*Bridge) PeerLocator

func (b *Bridge) PeerLocator(peer string) (string, error)

func (*Bridge) PersonalGroup

func (b *Bridge) PersonalGroup() string

func (*Bridge) Principal

func (b *Bridge) Principal() connect.Principal

func (*Bridge) PublishContact

func (b *Bridge) PublishContact(scope, name string, endpoints []Locator, withdraw bool) (Record, error)

func (*Bridge) SavePeer

func (b *Bridge) SavePeer(peer, locator string) error

func (*Bridge) SaveTransportState

func (b *Bridge) SaveTransportState(raw json.RawMessage) error

func (*Bridge) SetScope

func (b *Bridge) SetScope(id string, peers []string) error

func (*Bridge) TLSConfig

func (b *Bridge) TLSConfig(expected string, server bool) (*tls.Config, error)

func (*Bridge) TransportState

func (b *Bridge) TransportState() json.RawMessage

type Contact

type Contact struct {
	Schema     string                     `json:"schema"`
	Scope      string                     `json:"scope_id"`
	Peer       string                     `json:"peer_id"`
	Revision   string                     `json:"revision"`
	Name       string                     `json:"display_name"`
	Protocols  []string                   `json:"protocols"`
	Endpoints  []Locator                  `json:"endpoints"`
	Withdrawn  bool                       `json:"withdrawn"`
	Extensions map[string]json.RawMessage `json:"extensions,omitempty"`
}

type Grant

type Grant struct {
	ID            string            `json:"grant_id,omitempty"`
	Principal     connect.Principal `json:"principal"`
	GroupID       string            `json:"group_id,omitempty"`
	IncludeFuture bool              `json:"include_future"`
	Instances     []string          `json:"instances,omitempty"`
	Permissions   []string          `json:"permissions"`
	Destination   string            `json:"destination,omitempty"`
}

type Hello

type Hello struct {
	PeerID   string `json:"peer_id"`
	BootID   string `json:"bridge_boot_id"`
	Protocol string `json:"protocol"`
	MaxFrame int    `json:"max_frame"`
	MaxPage  int    `json:"max_page"`
}

type Instance

type Instance struct {
	ID         string `json:"instance_id"`
	Alias      string `json:"alias"`
	Group      string `json:"group_id"`
	Generation string `json:"registration_generation"`
	Credential string `json:"credential_hash,omitempty"`
	BootID     string `json:"boot_id,omitempty"`
	Available  bool   `json:"available"`
}

type Invitation

type Invitation struct {
	ClaimantLocator string  `json:"claimant_locator,omitempty"`
	ID              string  `json:"invitation_id"`
	PeerID          string  `json:"peer_id"`
	Token           string  `json:"token,omitempty"`
	Locator         string  `json:"locator,omitempty"`
	Expires         int64   `json:"expires"`
	Grants          []Grant `json:"grants"`
	Claimant        string  `json:"claimant,omitempty"`
	Status          string  `json:"status"`
}

type Locator

type Locator struct {
	Transport string `json:"transport"`
	Locator   string `json:"locator"`
}

type Record

type Record struct {
	Payload   string `json:"payload"`
	Signature string `json:"signature"`
}

func (Record) Verify

func (r Record) Verify() (Contact, error)

Directories

Path Synopsis
Package agent exposes independently opt-in, source-attributed bridge tools.
Package agent exposes independently opt-in, source-attributed bridge tools.
hosts
native
Package native supplies explicit filesystem and IPC adapters for Orb Bridge.
Package native supplies explicit filesystem and IPC adapters for Orb Bridge.
transports
tailcat
Package tailcat supplies stream transport only.
Package tailcat supplies stream transport only.

Jump to

Keyboard shortcuts

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