Documentation
¶
Index ¶
- Constants
- Variables
- func CfgCongestionMarking() bool
- func CfgFaceQueueSize() int
- func CfgLockThreadsToCores() bool
- func CfgTCPLifetime() time.Duration
- func CfgTCPUnicastPort() int
- func CfgUDP4MulticastAddress() string
- func CfgUDP6MulticastAddress() string
- func CfgUDPLifetime() time.Duration
- func CfgUDPMulticastPort() int
- func CfgUDPUnicastPort() int
- func CfgUnixSocketPath() string
- func Initialize()
- func InterfaceByIP(ip net.IP) (*net.Interface, error)
- func InterfaceByMAC(mac net.HardwareAddr) (*net.Interface, error)
- func RegisterInternalTransport() (LinkService, *InternalTransport)
- type HTTP3Listener
- type HTTP3ListenerConfig
- type HTTP3Transport
- func (t *HTTP3Transport) Close()
- func (t *HTTP3Transport) ExpirationPeriod() time.Duration
- func (t *HTTP3Transport) FaceID() uint64
- func (t *HTTP3Transport) GetSendQueueSize() uint64
- func (t *HTTP3Transport) IsRunning() bool
- func (t *HTTP3Transport) LinkType() defn.LinkType
- func (t *HTTP3Transport) LocalURI() *defn.URI
- func (t *HTTP3Transport) MTU() int
- func (t *HTTP3Transport) NInBytes() uint64
- func (t *HTTP3Transport) NOutBytes() uint64
- func (t *HTTP3Transport) Persistency() spec_mgmt.Persistency
- func (t *HTTP3Transport) RemoteURI() *defn.URI
- func (t *HTTP3Transport) Scope() defn.Scope
- func (t *HTTP3Transport) SetMTU(mtu int)
- func (t *HTTP3Transport) SetPersistency(persistency spec_mgmt.Persistency) bool
- func (t *HTTP3Transport) String() string
- type InternalTransport
- func (t *InternalTransport) Close()
- func (t *InternalTransport) ExpirationPeriod() time.Duration
- func (t *InternalTransport) FaceID() uint64
- func (t *InternalTransport) GetSendQueueSize() uint64
- func (t *InternalTransport) IsRunning() bool
- func (t *InternalTransport) LinkType() defn.LinkType
- func (t *InternalTransport) LocalURI() *defn.URI
- func (t *InternalTransport) MTU() int
- func (t *InternalTransport) NInBytes() uint64
- func (t *InternalTransport) NOutBytes() uint64
- func (t *InternalTransport) Persistency() spec_mgmt.Persistency
- func (t *InternalTransport) Receive() *spec.LpPacket
- func (t *InternalTransport) RemoteURI() *defn.URI
- func (t *InternalTransport) Scope() defn.Scope
- func (t *InternalTransport) Send(lpPkt *spec.LpPacket)
- func (t *InternalTransport) SetMTU(mtu int)
- func (t *InternalTransport) SetPersistency(persistency spec_mgmt.Persistency) bool
- func (t *InternalTransport) String() string
- type LinkService
- type Listener
- type MulticastUDPTransport
- func (t *MulticastUDPTransport) Close()
- func (t *MulticastUDPTransport) ExpirationPeriod() time.Duration
- func (t *MulticastUDPTransport) FaceID() uint64
- func (t *MulticastUDPTransport) GetSendQueueSize() uint64
- func (t *MulticastUDPTransport) IsRunning() bool
- func (t *MulticastUDPTransport) LinkType() defn.LinkType
- func (t *MulticastUDPTransport) LocalURI() *defn.URI
- func (t *MulticastUDPTransport) MTU() int
- func (t *MulticastUDPTransport) NInBytes() uint64
- func (t *MulticastUDPTransport) NOutBytes() uint64
- func (t *MulticastUDPTransport) Persistency() spec_mgmt.Persistency
- func (t *MulticastUDPTransport) RemoteURI() *defn.URI
- func (t *MulticastUDPTransport) Scope() defn.Scope
- func (t *MulticastUDPTransport) SetMTU(mtu int)
- func (t *MulticastUDPTransport) SetPersistency(persistency spec_mgmt.Persistency) bool
- func (t *MulticastUDPTransport) String() string
- type NDNLPLinkService
- func (l *NDNLPLinkService) Close()
- func (l *NDNLPLinkService) ExpirationPeriod() time.Duration
- func (l *NDNLPLinkService) FaceID() uint64
- func (l *NDNLPLinkService) LinkType() defn.LinkType
- func (l *NDNLPLinkService) LocalURI() *defn.URI
- func (l *NDNLPLinkService) MTU() int
- func (l *NDNLPLinkService) NInBytes() uint64
- func (l *NDNLPLinkService) NInData() uint64
- func (l *NDNLPLinkService) NInInterests() uint64
- func (l *NDNLPLinkService) NOutBytes() uint64
- func (l *NDNLPLinkService) NOutData() uint64
- func (l *NDNLPLinkService) NOutInterests() uint64
- func (l *NDNLPLinkService) Options() NDNLPLinkServiceOptions
- func (l *NDNLPLinkService) Persistency() spec_mgmt.Persistency
- func (l *NDNLPLinkService) RemoteURI() *defn.URI
- func (l *NDNLPLinkService) Run(initial []byte)
- func (l *NDNLPLinkService) Scope() defn.Scope
- func (l *NDNLPLinkService) SendPacket(out dispatch.OutPkt)
- func (l *NDNLPLinkService) SetFaceID(faceID uint64)
- func (l *NDNLPLinkService) SetMTU(mtu int)
- func (l *NDNLPLinkService) SetOptions(options NDNLPLinkServiceOptions)
- func (l *NDNLPLinkService) SetPersistency(persistency spec_mgmt.Persistency)
- func (l *NDNLPLinkService) State() defn.State
- func (l *NDNLPLinkService) String() string
- func (l *NDNLPLinkService) Transport() transport
- type NDNLPLinkServiceOptions
- type NullLinkService
- func (l *NullLinkService) Close()
- func (l *NullLinkService) ExpirationPeriod() time.Duration
- func (l *NullLinkService) FaceID() uint64
- func (l *NullLinkService) LinkType() defn.LinkType
- func (l *NullLinkService) LocalURI() *defn.URI
- func (l *NullLinkService) MTU() int
- func (l *NullLinkService) NInBytes() uint64
- func (l *NullLinkService) NInData() uint64
- func (l *NullLinkService) NInInterests() uint64
- func (l *NullLinkService) NOutBytes() uint64
- func (l *NullLinkService) NOutData() uint64
- func (l *NullLinkService) NOutInterests() uint64
- func (l *NullLinkService) Persistency() spec_mgmt.Persistency
- func (l *NullLinkService) RemoteURI() *defn.URI
- func (l *NullLinkService) Run(initial []byte)
- func (l *NullLinkService) Scope() defn.Scope
- func (l *NullLinkService) SendPacket(out dispatch.OutPkt)
- func (l *NullLinkService) SetFaceID(faceID uint64)
- func (l *NullLinkService) SetMTU(mtu int)
- func (l *NullLinkService) SetPersistency(persistency spec_mgmt.Persistency)
- func (l *NullLinkService) State() defn.State
- func (l *NullLinkService) String() string
- func (l *NullLinkService) Transport() transport
- type NullTransport
- func (t *NullTransport) Close()
- func (t *NullTransport) ExpirationPeriod() time.Duration
- func (t *NullTransport) FaceID() uint64
- func (t *NullTransport) GetSendQueueSize() uint64
- func (t *NullTransport) IsRunning() bool
- func (t *NullTransport) LinkType() defn.LinkType
- func (t *NullTransport) LocalURI() *defn.URI
- func (t *NullTransport) MTU() int
- func (t *NullTransport) NInBytes() uint64
- func (t *NullTransport) NOutBytes() uint64
- func (t *NullTransport) Persistency() spec_mgmt.Persistency
- func (t *NullTransport) RemoteURI() *defn.URI
- func (t *NullTransport) Scope() defn.Scope
- func (t *NullTransport) SetMTU(mtu int)
- func (t *NullTransport) SetPersistency(persistency spec_mgmt.Persistency) bool
- func (t *NullTransport) String() string
- type TCPListener
- type Table
- type UDPListener
- type UnicastTCPTransport
- func (t *UnicastTCPTransport) Close()
- func (t *UnicastTCPTransport) CloseConn()
- func (t *UnicastTCPTransport) ExpirationPeriod() time.Duration
- func (t *UnicastTCPTransport) FaceID() uint64
- func (t *UnicastTCPTransport) GetSendQueueSize() uint64
- func (t *UnicastTCPTransport) IsRunning() bool
- func (t *UnicastTCPTransport) LinkType() defn.LinkType
- func (t *UnicastTCPTransport) LocalURI() *defn.URI
- func (t *UnicastTCPTransport) MTU() int
- func (t *UnicastTCPTransport) NInBytes() uint64
- func (t *UnicastTCPTransport) NOutBytes() uint64
- func (t *UnicastTCPTransport) Persistency() spec_mgmt.Persistency
- func (t *UnicastTCPTransport) RemoteURI() *defn.URI
- func (t *UnicastTCPTransport) Scope() defn.Scope
- func (t *UnicastTCPTransport) SetMTU(mtu int)
- func (t *UnicastTCPTransport) SetPersistency(persistency spec_mgmt.Persistency) bool
- func (t *UnicastTCPTransport) String() string
- type UnicastUDPTransport
- func (t *UnicastUDPTransport) Close()
- func (t *UnicastUDPTransport) ExpirationPeriod() time.Duration
- func (t *UnicastUDPTransport) FaceID() uint64
- func (t *UnicastUDPTransport) GetSendQueueSize() uint64
- func (t *UnicastUDPTransport) IsRunning() bool
- func (t *UnicastUDPTransport) LinkType() defn.LinkType
- func (t *UnicastUDPTransport) LocalURI() *defn.URI
- func (t *UnicastUDPTransport) MTU() int
- func (t *UnicastUDPTransport) NInBytes() uint64
- func (t *UnicastUDPTransport) NOutBytes() uint64
- func (t *UnicastUDPTransport) Persistency() spec_mgmt.Persistency
- func (t *UnicastUDPTransport) RemoteURI() *defn.URI
- func (t *UnicastUDPTransport) Scope() defn.Scope
- func (t *UnicastUDPTransport) SetMTU(mtu int)
- func (t *UnicastUDPTransport) SetPersistency(persistency spec_mgmt.Persistency) bool
- func (t *UnicastUDPTransport) String() string
- type UnixStreamListener
- type UnixStreamTransport
- func (t *UnixStreamTransport) Close()
- func (t *UnixStreamTransport) ExpirationPeriod() time.Duration
- func (t *UnixStreamTransport) FaceID() uint64
- func (t *UnixStreamTransport) GetSendQueueSize() uint64
- func (t *UnixStreamTransport) IsRunning() bool
- func (t *UnixStreamTransport) LinkType() defn.LinkType
- func (t *UnixStreamTransport) LocalURI() *defn.URI
- func (t *UnixStreamTransport) MTU() int
- func (t *UnixStreamTransport) NInBytes() uint64
- func (t *UnixStreamTransport) NOutBytes() uint64
- func (t *UnixStreamTransport) Persistency() spec_mgmt.Persistency
- func (t *UnixStreamTransport) RemoteURI() *defn.URI
- func (t *UnixStreamTransport) Scope() defn.Scope
- func (t *UnixStreamTransport) SetMTU(mtu int)
- func (t *UnixStreamTransport) SetPersistency(persistency spec_mgmt.Persistency) bool
- func (t *UnixStreamTransport) String() string
- type WebSocketListener
- type WebSocketListenerConfig
- type WebSocketTransport
- func (t *WebSocketTransport) Close()
- func (t *WebSocketTransport) ExpirationPeriod() time.Duration
- func (t *WebSocketTransport) FaceID() uint64
- func (t *WebSocketTransport) GetSendQueueSize() uint64
- func (t *WebSocketTransport) IsRunning() bool
- func (t *WebSocketTransport) LinkType() defn.LinkType
- func (t *WebSocketTransport) LocalURI() *defn.URI
- func (t *WebSocketTransport) MTU() int
- func (t *WebSocketTransport) NInBytes() uint64
- func (t *WebSocketTransport) NOutBytes() uint64
- func (t *WebSocketTransport) Persistency() spec_mgmt.Persistency
- func (t *WebSocketTransport) RemoteURI() *defn.URI
- func (t *WebSocketTransport) Scope() defn.Scope
- func (t *WebSocketTransport) SetMTU(mtu int)
- func (t *WebSocketTransport) SetPersistency(persistency spec_mgmt.Persistency) bool
- func (t *WebSocketTransport) String() string
Constants ¶
const ( FaceFlagLocalFields = 1 << iota FaceFlagLpReliabilityEnabled FaceFlagCongestionMarking )
Variables ¶
var StubTcpUri = defn.DecodeURIString("tcp://127.0.0.1:0")
URI to use when the local URI is unknown.
Functions ¶
func CfgCongestionMarking ¶ added in v1.4.3
func CfgCongestionMarking() bool
CfgCongestionMarking returns whether congestion marking is enabled or disabled.
func CfgFaceQueueSize ¶ added in v1.4.3
func CfgFaceQueueSize() int
CfgFaceQueueSize returns the maximum number of packets that can be buffered to be sent or received on a face.
func CfgLockThreadsToCores ¶ added in v1.4.3
func CfgLockThreadsToCores() bool
CfgLockThreadsToCores returns whether face threads will be locked to logical cores.
func CfgTCPLifetime ¶ added in v1.4.3
CfgTCPLifetime returns the lifetime of on-demand TCP faces after they become idle.
func CfgTCPUnicastPort ¶ added in v1.4.3
func CfgTCPUnicastPort() int
CfgTCPUnicastPort returns the configured unicast TCP port.
func CfgUDP4MulticastAddress ¶ added in v1.4.3
func CfgUDP4MulticastAddress() string
CfgUDP4MulticastAddress returns the configured multicast UDP4 address.
func CfgUDP6MulticastAddress ¶ added in v1.4.3
func CfgUDP6MulticastAddress() string
CfgUDP6MulticastAddress returns the configured multicast UDP6 address.
func CfgUDPLifetime ¶ added in v1.4.3
CfgUDPLifetime returns the lifetime of on-demand UDP faces after they become idle.
func CfgUDPMulticastPort ¶ added in v1.4.3
func CfgUDPMulticastPort() int
CfgUDPMulticastPort returns the configured multicast UDP port.
func CfgUDPUnicastPort ¶ added in v1.4.3
func CfgUDPUnicastPort() int
CfgUDPUnicastPort returns the configured unicast UDP port.
func CfgUnixSocketPath ¶ added in v1.4.3
func CfgUnixSocketPath() string
CfgUnixSocketPath returns the configured Unix socket file path.
func InterfaceByIP ¶
InterfaceByIP gets an interface by its IP address.
func InterfaceByMAC ¶
func InterfaceByMAC(mac net.HardwareAddr) (*net.Interface, error)
InterfaceByMAC gets an interface by its MAC address.
func RegisterInternalTransport ¶
func RegisterInternalTransport() (LinkService, *InternalTransport)
RegisterInternalTransport creates, registers, and starts an InternalTransport.
Types ¶
type HTTP3Listener ¶ added in v1.5.2
type HTTP3Listener struct {
// contains filtered or unexported fields
}
HTTP3Listener listens for incoming HTTP/3 WebTransport sessions.
func NewHTTP3Listener ¶ added in v1.5.2
func NewHTTP3Listener(cfg HTTP3ListenerConfig) (*HTTP3Listener, error)
(AI GENERATED DESCRIPTION): Creates a new HTTP/3 listener that loads the specified TLS credentials, registers a handler for the `/ndn` endpoint, and configures a WebTransport server to accept and serve incoming HTTP/3 connections.
func (*HTTP3Listener) Run ¶ added in v1.5.2
func (l *HTTP3Listener) Run()
(AI GENERATED DESCRIPTION): Runs the HTTP/3 listener, terminating the program with a fatal log if the server fails to start or stops unexpectedly (excluding the normal http.ErrServerClosed case).
func (*HTTP3Listener) String ¶ added in v1.5.2
func (l *HTTP3Listener) String() string
(AI GENERATED DESCRIPTION): Returns the literal string “HTTP/3 listener” as the textual representation of an HTTP/3 listener.
type HTTP3ListenerConfig ¶ added in v1.5.2
HTTP3ListenerConfig contains HTTP/3 WebTransport listener configuration.
func (HTTP3ListenerConfig) String ¶ added in v1.5.2
func (cfg HTTP3ListenerConfig) String() string
(AI GENERATED DESCRIPTION): Returns a human‑readable string that describes the HTTP3 listener configuration, showing its type and the URL it uses.
func (HTTP3ListenerConfig) URL ¶ added in v1.5.2
func (cfg HTTP3ListenerConfig) URL() *url.URL
(AI GENERATED DESCRIPTION): Returns a `*url.URL` with scheme “https” and host set to the listener’s address.
type HTTP3Transport ¶ added in v1.5.2
type HTTP3Transport struct {
// contains filtered or unexported fields
}
func NewHTTP3Transport ¶ added in v1.5.2
func NewHTTP3Transport(remote, local netip.AddrPort, c *webtransport.Session) (t *HTTP3Transport)
(AI GENERATED DESCRIPTION): Creates a new HTTP3Transport instance, initializing it with the given remote and local addresses, configuring its transport base parameters, and marking it as running.
func (*HTTP3Transport) Close ¶ added in v1.5.2
func (t *HTTP3Transport) Close()
(AI GENERATED DESCRIPTION): Closes the HTTP/3 transport by marking it stopped and shutting down the underlying connection without error.
func (*HTTP3Transport) ExpirationPeriod ¶ added in v1.5.2
ExpirationPeriod returns the time until this face expires. If transport not on-demand, returns 0.
func (*HTTP3Transport) FaceID ¶ added in v1.5.2
func (t *HTTP3Transport) FaceID() uint64
(AI GENERATED DESCRIPTION): Returns the unique face ID associated with this transport instance.
func (*HTTP3Transport) GetSendQueueSize ¶ added in v1.5.2
func (t *HTTP3Transport) GetSendQueueSize() uint64
(AI GENERATED DESCRIPTION): Returns the current size, in bytes, of the outgoing send queue for this HTTP/3 transport.
func (*HTTP3Transport) IsRunning ¶ added in v1.5.2
func (t *HTTP3Transport) IsRunning() bool
(AI GENERATED DESCRIPTION): Returns `true` if the transport instance is currently running, otherwise `false`.
func (*HTTP3Transport) LinkType ¶ added in v1.5.2
(AI GENERATED DESCRIPTION): Returns the link type associated with this transport.
func (*HTTP3Transport) LocalURI ¶ added in v1.5.2
(AI GENERATED DESCRIPTION): Returns the local URI of the transport instance.
func (*HTTP3Transport) MTU ¶ added in v1.5.2
func (t *HTTP3Transport) MTU() int
(AI GENERATED DESCRIPTION): Returns the maximum transmission unit (MTU) size configured for the transport instance.
func (*HTTP3Transport) NInBytes ¶ added in v1.5.2
func (t *HTTP3Transport) NInBytes() uint64
(AI GENERATED DESCRIPTION): Returns the total number of bytes received by the transport instance.
func (*HTTP3Transport) NOutBytes ¶ added in v1.5.2
func (t *HTTP3Transport) NOutBytes() uint64
(AI GENERATED DESCRIPTION): Returns the total number of bytes that have been sent through this transport.
func (*HTTP3Transport) Persistency ¶ added in v1.5.2
func (t *HTTP3Transport) Persistency() spec_mgmt.Persistency
(AI GENERATED DESCRIPTION): Returns the persistency mode associated with the transport base instance.
func (*HTTP3Transport) RemoteURI ¶ added in v1.5.2
(AI GENERATED DESCRIPTION): Retrieves and returns the remote URI associated with this transport instance.
func (*HTTP3Transport) Scope ¶ added in v1.5.2
(AI GENERATED DESCRIPTION): Retrieves and returns the transport’s scope value.
func (*HTTP3Transport) SetMTU ¶ added in v1.5.2
func (t *HTTP3Transport) SetMTU(mtu int)
(AI GENERATED DESCRIPTION): Sets the transport’s maximum transmission unit (MTU) to the specified integer value.
func (*HTTP3Transport) SetPersistency ¶ added in v1.5.2
func (t *HTTP3Transport) SetPersistency(persistency spec_mgmt.Persistency) bool
(AI GENERATED DESCRIPTION): Returns true if the given persistency setting is `OnDemand`, indicating the transport should use persistent mode only in that case.
func (*HTTP3Transport) String ¶ added in v1.5.2
func (t *HTTP3Transport) String() string
(AI GENERATED DESCRIPTION): Returns a human‑readable string summarizing the HTTP/3 transport, including its face ID, remote URI, and local URI.
type InternalTransport ¶
type InternalTransport struct {
// contains filtered or unexported fields
}
InternalTransport is a transport for use by internal YaNFD modules (e.g., management).
func MakeInternalTransport ¶
func MakeInternalTransport() *InternalTransport
MakeInternalTransport makes an InternalTransport.
func (*InternalTransport) Close ¶
func (t *InternalTransport) Close()
(AI GENERATED DESCRIPTION): Closes the transport by atomically marking it inactive and closing its receive‑queue channel, leaving the send queue to be garbage‑collected.
func (*InternalTransport) ExpirationPeriod ¶
ExpirationPeriod returns the time until this face expires. If transport not on-demand, returns 0.
func (*InternalTransport) FaceID ¶
func (t *InternalTransport) FaceID() uint64
(AI GENERATED DESCRIPTION): Returns the unique face ID associated with this transport instance.
func (*InternalTransport) GetSendQueueSize ¶
func (t *InternalTransport) GetSendQueueSize() uint64
GetSendQueueSize returns the current size of the send queue.
func (*InternalTransport) IsRunning ¶
func (t *InternalTransport) IsRunning() bool
(AI GENERATED DESCRIPTION): Returns `true` if the transport instance is currently running, otherwise `false`.
func (*InternalTransport) LinkType ¶
(AI GENERATED DESCRIPTION): Returns the link type associated with this transport.
func (*InternalTransport) LocalURI ¶
(AI GENERATED DESCRIPTION): Returns the local URI of the transport instance.
func (*InternalTransport) MTU ¶
func (t *InternalTransport) MTU() int
(AI GENERATED DESCRIPTION): Returns the maximum transmission unit (MTU) size configured for the transport instance.
func (*InternalTransport) NInBytes ¶
func (t *InternalTransport) NInBytes() uint64
(AI GENERATED DESCRIPTION): Returns the total number of bytes received by the transport instance.
func (*InternalTransport) NOutBytes ¶
func (t *InternalTransport) NOutBytes() uint64
(AI GENERATED DESCRIPTION): Returns the total number of bytes that have been sent through this transport.
func (*InternalTransport) Persistency ¶
func (t *InternalTransport) Persistency() spec_mgmt.Persistency
(AI GENERATED DESCRIPTION): Returns the persistency mode associated with the transport base instance.
func (*InternalTransport) Receive ¶
func (t *InternalTransport) Receive() *spec.LpPacket
Receive receives a packet from the perspective of the internal component.
func (*InternalTransport) RemoteURI ¶
(AI GENERATED DESCRIPTION): Retrieves and returns the remote URI associated with this transport instance.
func (*InternalTransport) Scope ¶
(AI GENERATED DESCRIPTION): Retrieves and returns the transport’s scope value.
func (*InternalTransport) Send ¶
func (t *InternalTransport) Send(lpPkt *spec.LpPacket)
Send sends a packet from the perspective of the internal component.
func (*InternalTransport) SetMTU ¶
func (t *InternalTransport) SetMTU(mtu int)
(AI GENERATED DESCRIPTION): Sets the transport’s maximum transmission unit (MTU) to the specified integer value.
func (*InternalTransport) SetPersistency ¶
func (t *InternalTransport) SetPersistency(persistency spec_mgmt.Persistency) bool
SetPersistency changes the persistency of the face.
func (*InternalTransport) String ¶
func (t *InternalTransport) String() string
(AI GENERATED DESCRIPTION): Returns a human‑readable string that identifies the internal transport’s face ID along with its remote and local URIs.
type LinkService ¶
type LinkService interface {
String() string
Transport() transport
SetFaceID(faceID uint64)
FaceID() uint64
LocalURI() *defn.URI
RemoteURI() *defn.URI
Persistency() spec_mgmt.Persistency
SetPersistency(persistency spec_mgmt.Persistency)
Scope() defn.Scope
LinkType() defn.LinkType
MTU() int
SetMTU(mtu int)
ExpirationPeriod() time.Duration
State() defn.State
// Run is the main entry point for running face thread
// initial is optional new incoming frame
Run(initial []byte)
// Add a packet to the send queue for this link service
SendPacket(out dispatch.OutPkt)
// Close the face
Close()
// Counters
NInInterests() uint64
NInData() uint64
NInBytes() uint64
NOutInterests() uint64
NOutData() uint64
NOutBytes() uint64
// contains filtered or unexported methods
}
LinkService is an interface for link service implementations
type Listener ¶
type Listener interface {
String() string
Run()
Close()
}
Listener listens for incoming unicast connections for a transport type.
type MulticastUDPTransport ¶
type MulticastUDPTransport struct {
// contains filtered or unexported fields
}
MulticastUDPTransport is a multicast UDP transport.
func MakeMulticastUDPTransport ¶
func MakeMulticastUDPTransport(localURI *defn.URI) (*MulticastUDPTransport, error)
MakeMulticastUDPTransport creates a new multicast UDP transport.
func (*MulticastUDPTransport) Close ¶
func (t *MulticastUDPTransport) Close()
(AI GENERATED DESCRIPTION): Gracefully shuts down the MulticastUDPTransport, closing its send and receive UDP connections if the transport was running.
func (*MulticastUDPTransport) ExpirationPeriod ¶
ExpirationPeriod returns the time until this face expires. If transport not on-demand, returns 0.
func (*MulticastUDPTransport) FaceID ¶
func (t *MulticastUDPTransport) FaceID() uint64
(AI GENERATED DESCRIPTION): Returns the unique face ID associated with this transport instance.
func (*MulticastUDPTransport) GetSendQueueSize ¶
func (t *MulticastUDPTransport) GetSendQueueSize() uint64
(AI GENERATED DESCRIPTION): Returns the current number of bytes queued in the MulticastUDPTransport’s UDP socket send buffer by querying the underlying socket via a raw system call.
func (*MulticastUDPTransport) IsRunning ¶
func (t *MulticastUDPTransport) IsRunning() bool
(AI GENERATED DESCRIPTION): Returns `true` if the transport instance is currently running, otherwise `false`.
func (*MulticastUDPTransport) LinkType ¶
(AI GENERATED DESCRIPTION): Returns the link type associated with this transport.
func (*MulticastUDPTransport) LocalURI ¶
(AI GENERATED DESCRIPTION): Returns the local URI of the transport instance.
func (*MulticastUDPTransport) MTU ¶
func (t *MulticastUDPTransport) MTU() int
(AI GENERATED DESCRIPTION): Returns the maximum transmission unit (MTU) size configured for the transport instance.
func (*MulticastUDPTransport) NInBytes ¶
func (t *MulticastUDPTransport) NInBytes() uint64
(AI GENERATED DESCRIPTION): Returns the total number of bytes received by the transport instance.
func (*MulticastUDPTransport) NOutBytes ¶
func (t *MulticastUDPTransport) NOutBytes() uint64
(AI GENERATED DESCRIPTION): Returns the total number of bytes that have been sent through this transport.
func (*MulticastUDPTransport) Persistency ¶
func (t *MulticastUDPTransport) Persistency() spec_mgmt.Persistency
(AI GENERATED DESCRIPTION): Returns the persistency mode associated with the transport base instance.
func (*MulticastUDPTransport) RemoteURI ¶
(AI GENERATED DESCRIPTION): Retrieves and returns the remote URI associated with this transport instance.
func (*MulticastUDPTransport) Scope ¶
(AI GENERATED DESCRIPTION): Retrieves and returns the transport’s scope value.
func (*MulticastUDPTransport) SetMTU ¶
func (t *MulticastUDPTransport) SetMTU(mtu int)
(AI GENERATED DESCRIPTION): Sets the transport’s maximum transmission unit (MTU) to the specified integer value.
func (*MulticastUDPTransport) SetPersistency ¶
func (t *MulticastUDPTransport) SetPersistency(persistency spec_mgmt.Persistency) bool
(AI GENERATED DESCRIPTION): Sets the transport’s persistency to Permanent if requested, returning true when the value is unchanged or accepted, and false for any other persistency value.
func (*MulticastUDPTransport) String ¶
func (t *MulticastUDPTransport) String() string
(AI GENERATED DESCRIPTION): Returns a formatted string that identifies the MulticastUDPTransport, including its face ID and remote/local URIs.
type NDNLPLinkService ¶
type NDNLPLinkService struct {
// contains filtered or unexported fields
}
NDNLPLinkService is a link service implementing the NDNLPv2 link protocol
func MakeNDNLPLinkService ¶
func MakeNDNLPLinkService(transport transport, options NDNLPLinkServiceOptions) *NDNLPLinkService
MakeNDNLPLinkService creates a new NDNLPv2 link service
func (*NDNLPLinkService) ExpirationPeriod ¶
ExpirationPeriod returns the time until the underlying transport expires. If transport not on-demand, returns 0.
func (*NDNLPLinkService) FaceID ¶
func (l *NDNLPLinkService) FaceID() uint64
FaceID returns the ID of the face
func (*NDNLPLinkService) MTU ¶
func (l *NDNLPLinkService) MTU() int
MTU returns the MTU of the underlying transport.
func (*NDNLPLinkService) NInBytes ¶
func (l *NDNLPLinkService) NInBytes() uint64
NInBytes returns the number of link-layer bytes received on this face.
func (*NDNLPLinkService) NInData ¶
func (l *NDNLPLinkService) NInData() uint64
NInData returns the number of Data packets received on this face.
func (*NDNLPLinkService) NInInterests ¶
func (l *NDNLPLinkService) NInInterests() uint64
NInInterests returns the number of Interests received on this face.
func (*NDNLPLinkService) NOutBytes ¶
func (l *NDNLPLinkService) NOutBytes() uint64
NOutBytes returns the number of link-layer bytes sent on this face.
func (*NDNLPLinkService) NOutData ¶
func (l *NDNLPLinkService) NOutData() uint64
NInData returns the number of Data packets sent on this face.
func (*NDNLPLinkService) NOutInterests ¶
func (l *NDNLPLinkService) NOutInterests() uint64
NOutInterests returns the number of Interests sent on this face.
func (*NDNLPLinkService) Options ¶
func (l *NDNLPLinkService) Options() NDNLPLinkServiceOptions
Options gets the settings of the NDNLPLinkService.
func (*NDNLPLinkService) Persistency ¶
func (l *NDNLPLinkService) Persistency() spec_mgmt.Persistency
Persistency returns the MTU of the underlying transport.
func (*NDNLPLinkService) Run ¶
func (l *NDNLPLinkService) Run(initial []byte)
Run starts the face and associated goroutines
func (*NDNLPLinkService) SendPacket ¶
SendPacket adds a packet to the send queue for this link service
func (*NDNLPLinkService) SetFaceID ¶
func (l *NDNLPLinkService) SetFaceID(faceID uint64)
(AI GENERATED DESCRIPTION): Sets the link service’s face ID and propagates the change to its underlying transport if one exists.
func (*NDNLPLinkService) SetMTU ¶
func (l *NDNLPLinkService) SetMTU(mtu int)
SetMTU sets the MTU of the underlying transport.
func (*NDNLPLinkService) SetOptions ¶
func (l *NDNLPLinkService) SetOptions(options NDNLPLinkServiceOptions)
SetOptions changes the settings of the NDNLPLinkService.
func (*NDNLPLinkService) SetPersistency ¶
func (l *NDNLPLinkService) SetPersistency(persistency spec_mgmt.Persistency)
SetPersistency sets the MTU of the underlying transport.
type NDNLPLinkServiceOptions ¶
type NDNLPLinkServiceOptions struct {
IsFragmentationEnabled bool
IsReassemblyEnabled bool
IsConsumerControlledForwardingEnabled bool
IsIncomingFaceIndicationEnabled bool
IsLocalCachePolicyEnabled bool
IsCongestionMarkingEnabled bool
BaseCongestionMarkingInterval time.Duration
DefaultCongestionThresholdBytes uint64
}
NDNLPLinkServiceOptions contains the settings for an NDNLPLinkService.
func MakeNDNLPLinkServiceOptions ¶
func MakeNDNLPLinkServiceOptions() NDNLPLinkServiceOptions
(AI GENERATED DESCRIPTION): Creates and returns the default NDN link‑service options: a 100 ms congestion‑marking interval, a 64 KiB congestion threshold, and both reassembly and fragmentation enabled.
func (*NDNLPLinkServiceOptions) Flags ¶
func (op *NDNLPLinkServiceOptions) Flags() (ret uint64)
(AI GENERATED DESCRIPTION): Computes and returns a bitmask of Face flags for the link service, setting bits for local fields when consumer‑controlled forwarding is enabled and for congestion marking when enabled.
type NullLinkService ¶
type NullLinkService struct {
// contains filtered or unexported fields
}
NullLinkService is a link service that drops all packets.
func MakeNullLinkService ¶
func MakeNullLinkService(transport transport) *NullLinkService
MakeNullLinkService makes a NullLinkService.
func (*NullLinkService) ExpirationPeriod ¶
ExpirationPeriod returns the time until the underlying transport expires. If transport not on-demand, returns 0.
func (*NullLinkService) FaceID ¶
func (l *NullLinkService) FaceID() uint64
FaceID returns the ID of the face
func (*NullLinkService) MTU ¶
func (l *NullLinkService) MTU() int
MTU returns the MTU of the underlying transport.
func (*NullLinkService) NInBytes ¶
func (l *NullLinkService) NInBytes() uint64
NInBytes returns the number of link-layer bytes received on this face.
func (*NullLinkService) NInData ¶
func (l *NullLinkService) NInData() uint64
NInData returns the number of Data packets received on this face.
func (*NullLinkService) NInInterests ¶
func (l *NullLinkService) NInInterests() uint64
NInInterests returns the number of Interests received on this face.
func (*NullLinkService) NOutBytes ¶
func (l *NullLinkService) NOutBytes() uint64
NOutBytes returns the number of link-layer bytes sent on this face.
func (*NullLinkService) NOutData ¶
func (l *NullLinkService) NOutData() uint64
NInData returns the number of Data packets sent on this face.
func (*NullLinkService) NOutInterests ¶
func (l *NullLinkService) NOutInterests() uint64
NOutInterests returns the number of Interests sent on this face.
func (*NullLinkService) Persistency ¶
func (l *NullLinkService) Persistency() spec_mgmt.Persistency
Persistency returns the MTU of the underlying transport.
func (*NullLinkService) Run ¶
func (l *NullLinkService) Run(initial []byte)
Run runs the NullLinkService.
func (*NullLinkService) SendPacket ¶
SendPacket adds a packet to the send queue for this link service
func (*NullLinkService) SetFaceID ¶
func (l *NullLinkService) SetFaceID(faceID uint64)
(AI GENERATED DESCRIPTION): Sets the link service’s face ID and propagates the change to its underlying transport if one exists.
func (*NullLinkService) SetMTU ¶
func (l *NullLinkService) SetMTU(mtu int)
SetMTU sets the MTU of the underlying transport.
func (*NullLinkService) SetPersistency ¶
func (l *NullLinkService) SetPersistency(persistency spec_mgmt.Persistency)
SetPersistency sets the MTU of the underlying transport.
type NullTransport ¶
type NullTransport struct {
// contains filtered or unexported fields
}
NullTransport is a transport that drops all packets.
func MakeNullTransport ¶
func MakeNullTransport() *NullTransport
MakeNullTransport makes a NullTransport.
func (*NullTransport) Close ¶
func (t *NullTransport) Close()
(AI GENERATED DESCRIPTION): Atomically marks the transport as inactive and, if it was previously running, sends a signal on the close channel to trigger shutdown.
func (*NullTransport) ExpirationPeriod ¶
ExpirationPeriod returns the time until this face expires. If transport not on-demand, returns 0.
func (*NullTransport) FaceID ¶
func (t *NullTransport) FaceID() uint64
(AI GENERATED DESCRIPTION): Returns the unique face ID associated with this transport instance.
func (*NullTransport) GetSendQueueSize ¶
func (t *NullTransport) GetSendQueueSize() uint64
GetSendQueueSize returns the current size of the send queue.
func (*NullTransport) IsRunning ¶
func (t *NullTransport) IsRunning() bool
(AI GENERATED DESCRIPTION): Returns `true` if the transport instance is currently running, otherwise `false`.
func (*NullTransport) LinkType ¶
(AI GENERATED DESCRIPTION): Returns the link type associated with this transport.
func (*NullTransport) LocalURI ¶
(AI GENERATED DESCRIPTION): Returns the local URI of the transport instance.
func (*NullTransport) MTU ¶
func (t *NullTransport) MTU() int
(AI GENERATED DESCRIPTION): Returns the maximum transmission unit (MTU) size configured for the transport instance.
func (*NullTransport) NInBytes ¶
func (t *NullTransport) NInBytes() uint64
(AI GENERATED DESCRIPTION): Returns the total number of bytes received by the transport instance.
func (*NullTransport) NOutBytes ¶
func (t *NullTransport) NOutBytes() uint64
(AI GENERATED DESCRIPTION): Returns the total number of bytes that have been sent through this transport.
func (*NullTransport) Persistency ¶
func (t *NullTransport) Persistency() spec_mgmt.Persistency
(AI GENERATED DESCRIPTION): Returns the persistency mode associated with the transport base instance.
func (*NullTransport) RemoteURI ¶
(AI GENERATED DESCRIPTION): Retrieves and returns the remote URI associated with this transport instance.
func (*NullTransport) Scope ¶
(AI GENERATED DESCRIPTION): Retrieves and returns the transport’s scope value.
func (*NullTransport) SetMTU ¶
func (t *NullTransport) SetMTU(mtu int)
(AI GENERATED DESCRIPTION): Sets the transport’s maximum transmission unit (MTU) to the specified integer value.
func (*NullTransport) SetPersistency ¶
func (t *NullTransport) SetPersistency(persistency spec_mgmt.Persistency) bool
SetPersistency changes the persistency of the face.
func (*NullTransport) String ¶
func (t *NullTransport) String() string
(AI GENERATED DESCRIPTION): Returns a formatted string describing the NullTransport, including its face ID, remote URI, and local URI.
type TCPListener ¶
type TCPListener struct {
// contains filtered or unexported fields
}
TCPListener listens for incoming TCP unicast connections.
func MakeTCPListener ¶
func MakeTCPListener(localURI *defn.URI) (*TCPListener, error)
MakeTCPListener constructs a TCPListener.
func (*TCPListener) Close ¶
func (l *TCPListener) Close()
(AI GENERATED DESCRIPTION): Closes the listener’s TCP connection and blocks until the listener has fully stopped.
func (*TCPListener) Run ¶
func (l *TCPListener) Run()
(AI GENERATED DESCRIPTION): Runs a TCP listener that accepts incoming connections, creates unicast TCP transports for each, and starts an NDN‑Link Service on every accepted face.
func (*TCPListener) String ¶
func (l *TCPListener) String() string
(AI GENERATED DESCRIPTION): Returns a formatted string identifying the TCPListener, displaying its local URI in the form `"tcp-listener (<localURI>)"`.
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table hold all faces used by the forwarder.
var FaceTable Table
FaceTable is the global face table for this forwarder
func (*Table) Get ¶
func (t *Table) Get(id uint64) LinkService
Get gets the face with the specified ID (if any) from the face table.
type UDPListener ¶
type UDPListener struct {
// contains filtered or unexported fields
}
UDPListener listens for incoming UDP unicast connections.
func MakeUDPListener ¶
func MakeUDPListener(localURI *defn.URI) (*UDPListener, error)
MakeUDPListener constructs a UDPListener.
func (*UDPListener) Close ¶
func (l *UDPListener) Close()
(AI GENERATED DESCRIPTION): Closes the UDP connection and blocks until the listener’s goroutine has terminated.
func (*UDPListener) String ¶
func (l *UDPListener) String() string
(AI GENERATED DESCRIPTION): Returns a string representation of a UDPListener, showing its local URI.
type UnicastTCPTransport ¶
type UnicastTCPTransport struct {
// contains filtered or unexported fields
}
UnicastTCPTransport is a unicast TCP transport.
func AcceptUnicastTCPTransport ¶
func AcceptUnicastTCPTransport( remoteConn net.Conn, localURI *defn.URI, persistency spec_mgmt.Persistency, ) (*UnicastTCPTransport, error)
Accept an incoming unicast TCP transport.
func MakeUnicastTCPTransport ¶
func MakeUnicastTCPTransport( remoteURI *defn.URI, localURI *defn.URI, persistency spec_mgmt.Persistency, ) (*UnicastTCPTransport, error)
Makes an outgoing unicast TCP transport.
func (*UnicastTCPTransport) Close ¶
func (t *UnicastTCPTransport) Close()
Close the connection permanently - this will not attempt to reconnect.
func (*UnicastTCPTransport) CloseConn ¶
func (t *UnicastTCPTransport) CloseConn()
Close the inner connection if running without closing the transport.
func (*UnicastTCPTransport) ExpirationPeriod ¶
ExpirationPeriod returns the time until this face expires. If transport not on-demand, returns 0.
func (*UnicastTCPTransport) FaceID ¶
func (t *UnicastTCPTransport) FaceID() uint64
(AI GENERATED DESCRIPTION): Returns the unique face ID associated with this transport instance.
func (*UnicastTCPTransport) GetSendQueueSize ¶
func (t *UnicastTCPTransport) GetSendQueueSize() uint64
(AI GENERATED DESCRIPTION): Retrieves the number of bytes currently queued in the underlying TCP socket’s send buffer for this transport.
func (*UnicastTCPTransport) IsRunning ¶
func (t *UnicastTCPTransport) IsRunning() bool
(AI GENERATED DESCRIPTION): Returns `true` if the transport instance is currently running, otherwise `false`.
func (*UnicastTCPTransport) LinkType ¶
(AI GENERATED DESCRIPTION): Returns the link type associated with this transport.
func (*UnicastTCPTransport) LocalURI ¶
(AI GENERATED DESCRIPTION): Returns the local URI of the transport instance.
func (*UnicastTCPTransport) MTU ¶
func (t *UnicastTCPTransport) MTU() int
(AI GENERATED DESCRIPTION): Returns the maximum transmission unit (MTU) size configured for the transport instance.
func (*UnicastTCPTransport) NInBytes ¶
func (t *UnicastTCPTransport) NInBytes() uint64
(AI GENERATED DESCRIPTION): Returns the total number of bytes received by the transport instance.
func (*UnicastTCPTransport) NOutBytes ¶
func (t *UnicastTCPTransport) NOutBytes() uint64
(AI GENERATED DESCRIPTION): Returns the total number of bytes that have been sent through this transport.
func (*UnicastTCPTransport) Persistency ¶
func (t *UnicastTCPTransport) Persistency() spec_mgmt.Persistency
(AI GENERATED DESCRIPTION): Returns the persistency mode associated with the transport base instance.
func (*UnicastTCPTransport) RemoteURI ¶
(AI GENERATED DESCRIPTION): Retrieves and returns the remote URI associated with this transport instance.
func (*UnicastTCPTransport) Scope ¶
(AI GENERATED DESCRIPTION): Retrieves and returns the transport’s scope value.
func (*UnicastTCPTransport) SetMTU ¶
func (t *UnicastTCPTransport) SetMTU(mtu int)
(AI GENERATED DESCRIPTION): Sets the transport’s maximum transmission unit (MTU) to the specified integer value.
func (*UnicastTCPTransport) SetPersistency ¶
func (t *UnicastTCPTransport) SetPersistency(persistency spec_mgmt.Persistency) bool
(AI GENERATED DESCRIPTION): Sets the persistency mode for the UnicastTCPTransport and reports success.
func (*UnicastTCPTransport) String ¶
func (t *UnicastTCPTransport) String() string
(AI GENERATED DESCRIPTION): Returns a human‑readable string describing the unicast‑TCP transport, including its face ID, remote URI, and local URI.
type UnicastUDPTransport ¶
type UnicastUDPTransport struct {
// contains filtered or unexported fields
}
UnicastUDPTransport is a unicast UDP transport.
func MakeUnicastUDPTransport ¶
func MakeUnicastUDPTransport( remoteURI *defn.URI, localURI *defn.URI, persistency spec_mgmt.Persistency, ) (*UnicastUDPTransport, error)
MakeUnicastUDPTransport creates a new unicast UDP transport.
func (*UnicastUDPTransport) Close ¶
func (t *UnicastUDPTransport) Close()
(AI GENERATED DESCRIPTION): Closes the UDP connection if it is currently active, atomically setting the running flag to false.
func (*UnicastUDPTransport) ExpirationPeriod ¶
ExpirationPeriod returns the time until this face expires. If transport not on-demand, returns 0.
func (*UnicastUDPTransport) FaceID ¶
func (t *UnicastUDPTransport) FaceID() uint64
(AI GENERATED DESCRIPTION): Returns the unique face ID associated with this transport instance.
func (*UnicastUDPTransport) GetSendQueueSize ¶
func (t *UnicastUDPTransport) GetSendQueueSize() uint64
(AI GENERATED DESCRIPTION): Retrieves the size (in bytes) of the underlying UDP socket’s send queue for this UnicastUDPTransport, logging a warning if the raw connection cannot be obtained.
func (*UnicastUDPTransport) IsRunning ¶
func (t *UnicastUDPTransport) IsRunning() bool
(AI GENERATED DESCRIPTION): Returns `true` if the transport instance is currently running, otherwise `false`.
func (*UnicastUDPTransport) LinkType ¶
(AI GENERATED DESCRIPTION): Returns the link type associated with this transport.
func (*UnicastUDPTransport) LocalURI ¶
(AI GENERATED DESCRIPTION): Returns the local URI of the transport instance.
func (*UnicastUDPTransport) MTU ¶
func (t *UnicastUDPTransport) MTU() int
(AI GENERATED DESCRIPTION): Returns the maximum transmission unit (MTU) size configured for the transport instance.
func (*UnicastUDPTransport) NInBytes ¶
func (t *UnicastUDPTransport) NInBytes() uint64
(AI GENERATED DESCRIPTION): Returns the total number of bytes received by the transport instance.
func (*UnicastUDPTransport) NOutBytes ¶
func (t *UnicastUDPTransport) NOutBytes() uint64
(AI GENERATED DESCRIPTION): Returns the total number of bytes that have been sent through this transport.
func (*UnicastUDPTransport) Persistency ¶
func (t *UnicastUDPTransport) Persistency() spec_mgmt.Persistency
(AI GENERATED DESCRIPTION): Returns the persistency mode associated with the transport base instance.
func (*UnicastUDPTransport) RemoteURI ¶
(AI GENERATED DESCRIPTION): Retrieves and returns the remote URI associated with this transport instance.
func (*UnicastUDPTransport) Scope ¶
(AI GENERATED DESCRIPTION): Retrieves and returns the transport’s scope value.
func (*UnicastUDPTransport) SetMTU ¶
func (t *UnicastUDPTransport) SetMTU(mtu int)
(AI GENERATED DESCRIPTION): Sets the transport’s maximum transmission unit (MTU) to the specified integer value.
func (*UnicastUDPTransport) SetPersistency ¶
func (t *UnicastUDPTransport) SetPersistency(persistency spec_mgmt.Persistency) bool
(AI GENERATED DESCRIPTION): Sets the persistency mode on the UnicastUDPTransport instance and returns true to indicate success.
func (*UnicastUDPTransport) String ¶
func (t *UnicastUDPTransport) String() string
(AI GENERATED DESCRIPTION): Returns a human‑readable string that identifies the unicast UDP transport by its face ID, remote URI, and local URI.
type UnixStreamListener ¶
type UnixStreamListener struct {
// contains filtered or unexported fields
}
UnixStreamListener listens for incoming Unix stream connections.
func MakeUnixStreamListener ¶
func MakeUnixStreamListener(localURI *defn.URI) (*UnixStreamListener, error)
MakeUnixStreamListener constructs a UnixStreamListener.
func (*UnixStreamListener) Close ¶
func (l *UnixStreamListener) Close()
(AI GENERATED DESCRIPTION): Closes the listener’s underlying connection if it exists and blocks until the listener’s stopped channel signals that it has fully stopped.
func (*UnixStreamListener) Run ¶
func (l *UnixStreamListener) Run()
(AI GENERATED DESCRIPTION): Runs a Unix‑domain socket listener that accepts incoming stream connections, creates an NDN link service for each connection, and starts it until the program exits.
func (*UnixStreamListener) String ¶
func (l *UnixStreamListener) String() string
(AI GENERATED DESCRIPTION): Returns a human‑readable string identifying the UnixStreamListener, including its local URI.
type UnixStreamTransport ¶
type UnixStreamTransport struct {
// contains filtered or unexported fields
}
UnixStreamTransport is a Unix stream transport for communicating with local applications.
func MakeUnixStreamTransport ¶
func MakeUnixStreamTransport(remoteURI *defn.URI, localURI *defn.URI, conn net.Conn) (*UnixStreamTransport, error)
MakeUnixStreamTransport creates a Unix stream transport.
func (*UnixStreamTransport) Close ¶
func (t *UnixStreamTransport) Close()
(AI GENERATED DESCRIPTION): Marks the Unix stream transport as stopped and closes its underlying connection if it was running.
func (*UnixStreamTransport) ExpirationPeriod ¶
ExpirationPeriod returns the time until this face expires. If transport not on-demand, returns 0.
func (*UnixStreamTransport) FaceID ¶
func (t *UnixStreamTransport) FaceID() uint64
(AI GENERATED DESCRIPTION): Returns the unique face ID associated with this transport instance.
func (*UnixStreamTransport) GetSendQueueSize ¶
func (t *UnixStreamTransport) GetSendQueueSize() uint64
GetSendQueueSize returns the current size of the send queue.
func (*UnixStreamTransport) IsRunning ¶
func (t *UnixStreamTransport) IsRunning() bool
(AI GENERATED DESCRIPTION): Returns `true` if the transport instance is currently running, otherwise `false`.
func (*UnixStreamTransport) LinkType ¶
(AI GENERATED DESCRIPTION): Returns the link type associated with this transport.
func (*UnixStreamTransport) LocalURI ¶
(AI GENERATED DESCRIPTION): Returns the local URI of the transport instance.
func (*UnixStreamTransport) MTU ¶
func (t *UnixStreamTransport) MTU() int
(AI GENERATED DESCRIPTION): Returns the maximum transmission unit (MTU) size configured for the transport instance.
func (*UnixStreamTransport) NInBytes ¶
func (t *UnixStreamTransport) NInBytes() uint64
(AI GENERATED DESCRIPTION): Returns the total number of bytes received by the transport instance.
func (*UnixStreamTransport) NOutBytes ¶
func (t *UnixStreamTransport) NOutBytes() uint64
(AI GENERATED DESCRIPTION): Returns the total number of bytes that have been sent through this transport.
func (*UnixStreamTransport) Persistency ¶
func (t *UnixStreamTransport) Persistency() spec_mgmt.Persistency
(AI GENERATED DESCRIPTION): Returns the persistency mode associated with the transport base instance.
func (*UnixStreamTransport) RemoteURI ¶
(AI GENERATED DESCRIPTION): Retrieves and returns the remote URI associated with this transport instance.
func (*UnixStreamTransport) Scope ¶
(AI GENERATED DESCRIPTION): Retrieves and returns the transport’s scope value.
func (*UnixStreamTransport) SetMTU ¶
func (t *UnixStreamTransport) SetMTU(mtu int)
(AI GENERATED DESCRIPTION): Sets the transport’s maximum transmission unit (MTU) to the specified integer value.
func (*UnixStreamTransport) SetPersistency ¶
func (t *UnixStreamTransport) SetPersistency(persistency spec_mgmt.Persistency) bool
SetPersistency changes the persistency of the face.
func (*UnixStreamTransport) String ¶
func (t *UnixStreamTransport) String() string
(AI GENERATED DESCRIPTION): Returns a human‑readable string describing the Unix stream transport, including its face ID, remote URI, and local URI.
type WebSocketListener ¶
type WebSocketListener struct {
// contains filtered or unexported fields
}
WebSocketListener listens for incoming WebSockets connections.
func NewWebSocketListener ¶
func NewWebSocketListener(cfg WebSocketListenerConfig) (*WebSocketListener, error)
(AI GENERATED DESCRIPTION): Creates a WebSocketListener configured with the given URL and TLS options, initializing its HTTP server, upgrader, and local URI for the listener.
func (*WebSocketListener) Close ¶
func (l *WebSocketListener) Close()
(AI GENERATED DESCRIPTION): Stops the WebSocket listener by shutting down its underlying HTTP server and logs the stopping action.
func (*WebSocketListener) Run ¶
func (l *WebSocketListener) Run()
(AI GENERATED DESCRIPTION): Starts the WebSocket listener by assigning its handler to the HTTP server and invoking ListenAndServe (or ListenAndServeTLS if TLS is configured), logging a fatal error unless the failure is due to a normal server shutdown.
func (*WebSocketListener) String ¶
func (l *WebSocketListener) String() string
(AI GENERATED DESCRIPTION): Returns a human‑readable description of the WebSocketListener, including its type and local URI.
type WebSocketListenerConfig ¶
type WebSocketListenerConfig struct {
Bind string
Port uint16
TLSEnabled bool
TLSCert string
TLSKey string
}
WebSocketListenerConfig contains WebSocketListener configuration.
func (WebSocketListenerConfig) String ¶
func (cfg WebSocketListenerConfig) String() string
(AI GENERATED DESCRIPTION): Returns a string describing the WebSocketListenerConfig, showing its URL and TLS certificate path.
func (WebSocketListenerConfig) URL ¶
func (cfg WebSocketListenerConfig) URL() *url.URL
(AI GENERATED DESCRIPTION): Generates a *url.URL for a WebSocket listener by joining the bind address and port, and selecting the scheme “ws” or “wss” based on the TLS enabled flag.
type WebSocketTransport ¶
type WebSocketTransport struct {
// contains filtered or unexported fields
}
WebSocketTransport communicates with web applications via WebSocket.
func NewWebSocketTransport ¶
func NewWebSocketTransport(localURI *defn.URI, c *websocket.Conn) (t *WebSocketTransport)
(AI GENERATED DESCRIPTION): Creates a new WebSocketTransport for the given websocket connection, initializing its remote URI, determining if it is local or non‑local, setting up base transport parameters, and marking the transport as running.
func (*WebSocketTransport) Close ¶
func (t *WebSocketTransport) Close()
(AI GENERATED DESCRIPTION): Stops the WebSocketTransport from running and closes the underlying WebSocket connection.
func (*WebSocketTransport) ExpirationPeriod ¶
ExpirationPeriod returns the time until this face expires. If transport not on-demand, returns 0.
func (*WebSocketTransport) FaceID ¶
func (t *WebSocketTransport) FaceID() uint64
(AI GENERATED DESCRIPTION): Returns the unique face ID associated with this transport instance.
func (*WebSocketTransport) GetSendQueueSize ¶
func (t *WebSocketTransport) GetSendQueueSize() uint64
(AI GENERATED DESCRIPTION): Returns the current number of packets queued for transmission on the WebSocket transport.
func (*WebSocketTransport) IsRunning ¶
func (t *WebSocketTransport) IsRunning() bool
(AI GENERATED DESCRIPTION): Returns `true` if the transport instance is currently running, otherwise `false`.
func (*WebSocketTransport) LinkType ¶
(AI GENERATED DESCRIPTION): Returns the link type associated with this transport.
func (*WebSocketTransport) LocalURI ¶
(AI GENERATED DESCRIPTION): Returns the local URI of the transport instance.
func (*WebSocketTransport) MTU ¶
func (t *WebSocketTransport) MTU() int
(AI GENERATED DESCRIPTION): Returns the maximum transmission unit (MTU) size configured for the transport instance.
func (*WebSocketTransport) NInBytes ¶
func (t *WebSocketTransport) NInBytes() uint64
(AI GENERATED DESCRIPTION): Returns the total number of bytes received by the transport instance.
func (*WebSocketTransport) NOutBytes ¶
func (t *WebSocketTransport) NOutBytes() uint64
(AI GENERATED DESCRIPTION): Returns the total number of bytes that have been sent through this transport.
func (*WebSocketTransport) Persistency ¶
func (t *WebSocketTransport) Persistency() spec_mgmt.Persistency
(AI GENERATED DESCRIPTION): Returns the persistency mode associated with the transport base instance.
func (*WebSocketTransport) RemoteURI ¶
(AI GENERATED DESCRIPTION): Retrieves and returns the remote URI associated with this transport instance.
func (*WebSocketTransport) Scope ¶
(AI GENERATED DESCRIPTION): Retrieves and returns the transport’s scope value.
func (*WebSocketTransport) SetMTU ¶
func (t *WebSocketTransport) SetMTU(mtu int)
(AI GENERATED DESCRIPTION): Sets the transport’s maximum transmission unit (MTU) to the specified integer value.
func (*WebSocketTransport) SetPersistency ¶
func (t *WebSocketTransport) SetPersistency(persistency spec_mgmt.Persistency) bool
(AI GENERATED DESCRIPTION): Returns true if the supplied persistency mode is PersistencyOnDemand; otherwise returns false.
func (*WebSocketTransport) String ¶
func (t *WebSocketTransport) String() string
(AI GENERATED DESCRIPTION): Returns a formatted string summarizing the WebSocket transport, including its face ID, remote URI, and local URI.
Source Files
¶
- config.go
- http3-listener.go
- http3-transport.go
- interfaces.go
- internal-transport.go
- link-service.go
- listener.go
- multicast-udp-transport.go
- ndnlp-link-service.go
- null-link-service.go
- null-transport.go
- table.go
- tcp-listener.go
- transport.go
- udp-listener.go
- unicast-tcp-transport.go
- unicast-udp-transport.go
- unix-stream-listener.go
- unix-stream-transport.go
- web-socket-listener.go
- web-socket-transport.go