Documentation
¶
Index ¶
- func SignHTTPRequest(req *http.Request, body []byte, priv bifrost_crypto.PrivKey, pid peer.ID, ...) error
- type SessionTransport
- func (t *SessionTransport) AwaitReady(ctx context.Context) error
- func (t *SessionTransport) Execute(ctx context.Context) error
- func (t *SessionTransport) GetChildBus() bus.Bus
- func (t *SessionTransport) GetLinkSnapshotsWithWait() ([]transport_controller.LinkSnapshot, <-chan struct{})
- func (t *SessionTransport) GetLinkedPeerIDsSnapshotWithWait(peerIDs []peer.ID) (map[peer.ID]struct{}, <-chan struct{})
- func (t *SessionTransport) GetPeerID() peer.ID
- func (t *SessionTransport) Ready() <-chan struct{}
- type SessionTransportOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SessionTransport ¶
type SessionTransport struct {
// contains filtered or unexported fields
}
SessionTransport manages a session-scoped child bus with bifrost transport controllers bound to the session's peer identity.
func NewSessionTransport ¶
func NewSessionTransport( le *logrus.Entry, parentBus bus.Bus, sessionKey bifrost_crypto.PrivKey, signalingURL string, signingEnvPfx string, opts ...SessionTransportOption, ) (*SessionTransport, error)
NewSessionTransport constructs a new session-scoped transport.
The child bus is created in Execute. The sessionKey is the session's Ed25519 private key used as the transport peer identity.
signalingURL is the cloud API base URL for the SignalingDO endpoint. If empty, WebRTC and signaling controllers are not started.
func (*SessionTransport) AwaitReady ¶
func (t *SessionTransport) AwaitReady(ctx context.Context) error
AwaitReady blocks until the transport's child bus is created and base controllers are started, or until ctx is canceled.
func (*SessionTransport) Execute ¶
func (t *SessionTransport) Execute(ctx context.Context) error
Execute creates the child bus with bifrost transport controllers and blocks until ctx is canceled.
func (*SessionTransport) GetChildBus ¶
func (t *SessionTransport) GetChildBus() bus.Bus
GetChildBus returns the child bus, or nil if not yet started.
func (*SessionTransport) GetLinkSnapshotsWithWait ¶ added in v0.54.0
func (t *SessionTransport) GetLinkSnapshotsWithWait() ([]transport_controller.LinkSnapshot, <-chan struct{})
GetLinkSnapshotsWithWait returns live link snapshots and a wait channel that closes when the transport link set changes.
func (*SessionTransport) GetLinkedPeerIDsSnapshotWithWait ¶ added in v0.51.7
func (t *SessionTransport) GetLinkedPeerIDsSnapshotWithWait(peerIDs []peer.ID) (map[peer.ID]struct{}, <-chan struct{})
GetLinkedPeerIDsSnapshotWithWait returns linked peer IDs and a wait channel that closes when the transport link set changes.
func (*SessionTransport) GetPeerID ¶
func (t *SessionTransport) GetPeerID() peer.ID
GetPeerID returns the transport's peer ID.
func (*SessionTransport) Ready ¶
func (t *SessionTransport) Ready() <-chan struct{}
Ready returns a channel that is closed when the child bus and base controllers are started.
type SessionTransportOption ¶ added in v0.56.1
type SessionTransportOption func(*SessionTransport)
SessionTransportOption configures child-bus directive routing.
func WithBridgeDirectiveFilter ¶ added in v0.56.1
func WithBridgeDirectiveFilter(filter bus_bridge.FilterFn) SessionTransportOption
WithBridgeDirectiveFilter excludes matching directives from the generic child-to-parent bridge while preserving the transport package's ownership.