rdr

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RdrNodeDesc        *schema.NodeImplDesc
	SegmentedNodeDesc  *schema.NodeImplDesc
	GeneralObjNodeDesc *schema.NodeImplDesc
)

Functions

func CreateGeneralObjNode

func CreateGeneralObjNode(node *schema.Node) schema.NodeImpl

(AI GENERATED DESCRIPTION): Creates a GeneralObjNode attached to the supplied schema node, initializes its freshness and retry limits, and registers child nodes for the data, metadata, and manifest segments of a general object.

func CreateRdrNode

func CreateRdrNode(node *schema.Node) schema.NodeImpl

(AI GENERATED DESCRIPTION): Initializes a Reader node implementation, sets its metadata freshness and retry limits, and registers child node descriptors for a versioned metadata segment (including a leaf for segment 0) within the supplied schema node.

func CreateSegmentedNode

func CreateSegmentedNode(node *schema.Node) schema.NodeImpl

(AI GENERATED DESCRIPTION): Creates a SegmentedNode configured with default segmentation parameters, registers a leaf node for segment numbers in the supplied schema node, and returns the configured NodeImpl.

func DataFetcher

func DataFetcher(mNode schema.MatchedNode, intConfig *ndn.InterestConfig, maxRetries int) schema.NeedResult

DataFetcher tries to get specified Data packet up to `maxRetries` times.

Types

type GeneralObjNode

type GeneralObjNode struct {
	schema.BaseNodeImpl

	MetaFreshness         time.Duration
	MaxRetriesForMeta     uint64
	ManifestFreshness     time.Duration
	MaxRetriesForManifest uint64
}

GeneralObject in CNL

func (*GeneralObjNode) CastTo

func (n *GeneralObjNode) CastTo(ptr any) any

(AI GENERATED DESCRIPTION): Casts a GeneralObjNode to the requested type, returning the node itself for *GeneralObjNode, its embedded BaseNodeImpl for *schema.BaseNodeImpl, or nil for unsupported types.

func (*GeneralObjNode) NeedCallback

func (n *GeneralObjNode) NeedCallback(mNode schema.MatchedNode, callback schema.Callback)

(AI GENERATED DESCRIPTION): Requests a manifest for the given matched node, parses it, then requests each segment listed in the manifest, passing the results to the supplied callback.

func (*GeneralObjNode) NeedChan

func (n *GeneralObjNode) NeedChan(mNode schema.MatchedNode) chan schema.NeedResult

(AI GENERATED DESCRIPTION): Creates and returns a channel that will receive a `NeedResult` when the node’s `NeedCallback` processes a need event for the specified matched node.

func (*GeneralObjNode) NodeImplTrait

func (n *GeneralObjNode) NodeImplTrait() schema.NodeImpl

(AI GENERATED DESCRIPTION): Returns the `GeneralObjNode` as a `schema.NodeImpl` interface implementation.

func (*GeneralObjNode) Provide

func (n *GeneralObjNode) Provide(mNode schema.MatchedNode, content enc.Wire) uint64

(AI GENERATED DESCRIPTION): Generates and registers segmented data, its metadata, and a manifest for the matched node, storing each as Data packets in the NTSchema tree and returning the number of segments.

func (*GeneralObjNode) String added in v1.4.3

func (n *GeneralObjNode) String() string

(AI GENERATED DESCRIPTION): Returns a formatted string representing the GeneralObjNode, including its type label and the underlying Node value.

type RdrNode

type RdrNode struct {
	schema.BaseNodeImpl

	MetaFreshness     time.Duration
	MaxRetriesForMeta uint64
}

RdrNode handles the version discovery

func (*RdrNode) CastTo

func (n *RdrNode) CastTo(ptr any) any

(AI GENERATED DESCRIPTION): Casts an RdrNode to the requested target type, returning the node or its embedded BaseNodeImpl pointer when the argument’s type matches, otherwise returning nil.

func (*RdrNode) NeedCallback

func (n *RdrNode) NeedCallback(mNode schema.MatchedNode, callback schema.Callback, version *uint64)

(AI GENERATED DESCRIPTION): Initiates an asynchronous need request for a node: if no version is supplied it first fetches the node’s metadata (retrying up to MaxRetriesForMeta) to determine the full name, then requests the data for that name and calls the supplied callback with the result.

func (*RdrNode) NeedChan

func (n *RdrNode) NeedChan(mNode schema.MatchedNode, version *uint64) chan schema.NeedResult

(AI GENERATED DESCRIPTION): Creates a one‑shot channel that receives the `NeedResult` of a Need operation on the given matched node, by registering a callback that forwards the event to the channel and then closes it.

func (*RdrNode) NodeImplTrait

func (n *RdrNode) NodeImplTrait() schema.NodeImpl

(AI GENERATED DESCRIPTION): Returns the receiver RdrNode as a schema.NodeImpl implementation.

func (*RdrNode) Provide

func (n *RdrNode) Provide(mNode schema.MatchedNode, content enc.Wire) uint64

(AI GENERATED DESCRIPTION): Provides a matched node with the given content by creating a versioned, segmented Data packet, storing a corresponding metadata packet in storage, and returning the version timestamp used.

func (*RdrNode) String added in v1.4.3

func (n *RdrNode) String() string

(AI GENERATED DESCRIPTION): Returns a string representation of the RdrNode as `"RdrNode (<node>)"`, where `<node>` is the string form of its embedded Node field.

type RdrPipeline

type RdrPipeline interface {
}

type RdrPipelineAdaptive

type RdrPipelineAdaptive struct {
	InitCwnd         float64
	InitSsthresh     float64
	RtoCheckInterval time.Duration
	IgnoreCongMarks  bool
	DisableCwa       bool
}

type RdrPipelineAimd

type RdrPipelineAimd struct {
	RdrPipelineAdaptive

	AiStep          float64
	MdCoef          float64
	ResetCwndToInit bool
}

type RdrPipelineCubic

type RdrPipelineCubic struct {
	RdrPipelineAdaptive

	CubicBeta      float64
	EnableFastConv bool
}

type RdrPipelineFixed

type RdrPipelineFixed struct {
	MaxPipelineSize uint64
}

func (*RdrPipelineFixed) Run

func (p *RdrPipelineFixed) Run(mNode schema.MatchedNode, callback schema.Callback, manifest []enc.Buffer)

Run executes the pipeline in a standalone goroutine with blocking setting.

type SegmentedNode

type SegmentedNode struct {
	schema.BaseNodeImpl

	ContentType         ndn.ContentType
	Freshness           time.Duration
	ValidDur            time.Duration
	Lifetime            time.Duration
	MustBeFresh         bool
	SegmentSize         uint64
	MaxRetriesOnFailure uint64
	Pipeline            string
}

SegmentedNode handles the segmentation and reassembly

func (*SegmentedNode) CastTo

func (n *SegmentedNode) CastTo(ptr any) any

(AI GENERATED DESCRIPTION): Casts the `SegmentedNode` to the requested type, returning itself when queried as `*SegmentedNode` or its embedded `BaseNodeImpl` when queried as `*schema.BaseNodeImpl`, and `nil` for unsupported types.

func (*SegmentedNode) NeedCallback

func (n *SegmentedNode) NeedCallback(
	mNode schema.MatchedNode, callback schema.Callback, manifest []enc.Buffer) error

(AI GENERATED DESCRIPTION): Starts the appropriate callback pipeline for a matched node (e.g., SinglePacket) asynchronously, or returns an error if the pipeline type is unsupported.

func (*SegmentedNode) NeedChan

func (n *SegmentedNode) NeedChan(mNode schema.MatchedNode, manifest []enc.Buffer) chan schema.NeedResult

(AI GENERATED DESCRIPTION): Triggers a need request on the node and returns a channel that receives the resulting NeedResult when the callback is invoked.

func (*SegmentedNode) NodeImplTrait

func (n *SegmentedNode) NodeImplTrait() schema.NodeImpl

(AI GENERATED DESCRIPTION): Returns the SegmentedNode itself as a schema.NodeImpl for use by the node’s interface.

func (*SegmentedNode) Provide

func (n *SegmentedNode) Provide(mNode schema.MatchedNode, content enc.Wire, needManifest bool) any

(AI GENERATED DESCRIPTION): Splits the supplied content into fixed‑size segments, generates a Data packet for each segment by invoking the schema’s Provide method, and returns either the segment count or, if requested, the implicit SHA256 digests of each segment for a manifest.

func (*SegmentedNode) SinglePacketPipeline

func (n *SegmentedNode) SinglePacketPipeline(
	mNode schema.MatchedNode, callback schema.Callback, manifest []enc.Buffer,
)

(AI GENERATED DESCRIPTION): Retrieves and concatenates all segments of a segmented Data packet (using an optional manifest to locate segments), then invokes the callback with an event summarizing the collected fragments and the final fetch status.

func (*SegmentedNode) String added in v1.4.3

func (n *SegmentedNode) String() string

(AI GENERATED DESCRIPTION): Returns a formatted string that identifies the SegmentedNode by embedding its underlying Node value.

Jump to

Keyboard shortcuts

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