Documentation
¶
Index ¶
- func ExpressR(engine ndn.Engine, args ndn.ExpressRArgs)
- func NewClient(engine ndn.Engine, store ndn.Store, trust *sec.TrustConfig) ndn.Client
- func Produce(args ndn.ProduceArgs, store ndn.Store, signer ndn.Signer) (enc.Name, error)
- type Client
- func (c *Client) AnnouncePrefix(args ndn.Announcement)
- func (c *Client) AttachCommandHandler(handlerName enc.Name, handler func(enc.Name, enc.Wire, func(enc.Wire) error)) error
- func (c *Client) Consume(name enc.Name, callback func(status ndn.ConsumeState))
- func (c *Client) ConsumeExt(args ndn.ConsumeExtArgs)
- func (c *Client) DetachCommandHandler(name enc.Name) error
- func (c *Client) Engine() ndn.Engine
- func (c *Client) ExpressCommand(dest enc.Name, name enc.Name, cmd enc.Wire, callback func(enc.Wire, error))
- func (c *Client) ExpressR(args ndn.ExpressRArgs)
- func (c *Client) GetLocal(name enc.Name) (enc.Wire, error)
- func (c *Client) IsCongested() bool
- func (c *Client) LatestLocal(name enc.Name) (enc.Name, error)
- func (c *Client) Produce(args ndn.ProduceArgs) (enc.Name, error)
- func (c *Client) Remove(name enc.Name) error
- func (c *Client) Start() error
- func (c *Client) Stop() error
- func (c *Client) Store() ndn.Store
- func (c *Client) String() string
- func (c *Client) SuggestSigner(name enc.Name) ndn.Signer
- func (c *Client) Validate(data ndn.Data, sigCov enc.Wire, callback func(bool, error))
- func (c *Client) ValidateExt(args ndn.ValidateExtArgs)
- func (c *Client) WithdrawPrefix(name enc.Name, onError func(error))
- type ConsumeState
- func (a *ConsumeState) Cancel()
- func (a *ConsumeState) Content() enc.Wire
- func (a *ConsumeState) Error() error
- func (a *ConsumeState) IsComplete() bool
- func (a *ConsumeState) Name() enc.Name
- func (a *ConsumeState) Progress() int
- func (a *ConsumeState) ProgressMax() int
- func (a *ConsumeState) Version() uint64
- type FetchWindow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpressR ¶
func ExpressR(engine ndn.Engine, args ndn.ExpressRArgs)
Express a single interest with reliability
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AnnouncePrefix ¶
func (c *Client) AnnouncePrefix(args ndn.Announcement)
Registers an NDN prefix announcement by storing it under the TLV-encoded name hash and initiates asynchronous announcement via the network face if it is running.
func (*Client) AttachCommandHandler ¶
func (c *Client) AttachCommandHandler( handlerName enc.Name, handler func(enc.Name, enc.Wire, func(enc.Wire) error), ) error
Registers a command handler that processes NDN Interest packets with application parameters, validates the enclosed command data, and executes the provided handler to generate a signed response Data packet.
func (*Client) Consume ¶
func (c *Client) Consume(name enc.Name, callback func(status ndn.ConsumeState))
Consume an object with a given name
func (*Client) ConsumeExt ¶
func (c *Client) ConsumeExt(args ndn.ConsumeExtArgs)
ConsumeExt is a more advanced consume API that allows for more control over the fetching process.
func (*Client) DetachCommandHandler ¶
Detaches the command handler associated with the given name from the client's engine, returning an error if detachment fails.
func (*Client) ExpressCommand ¶
func (c *Client) ExpressCommand(dest enc.Name, name enc.Name, cmd enc.Wire, callback func(enc.Wire, error))
Sends a signed command as a Data packet via an Interest to the specified destination, expecting a validated response, and invokes the provided callback with the result or an error.
func (*Client) ExpressR ¶
func (c *Client) ExpressR(args ndn.ExpressRArgs)
Express a single interest with reliability
func (*Client) IsCongested ¶
IsCongested returns true if the client is congested
func (*Client) LatestLocal ¶
LatestLocal returns the latest version name of an object in the store
func (*Client) Produce ¶
Produce and sign data, and insert into the client's store. The input data will be freed as the object is segmented.
func (*Client) SuggestSigner ¶
SuggestSigner returns the signer for a given name nil is returned if no signer is found
func (*Client) ValidateExt ¶
func (c *Client) ValidateExt(args ndn.ValidateExtArgs)
ValidateExt is an advanced API for validating data packets
type ConsumeState ¶
type ConsumeState struct {
// contains filtered or unexported fields
}
arguments for the consume callback
func (*ConsumeState) Content ¶
func (a *ConsumeState) Content() enc.Wire
returns the currently available buffer in the content any subsequent calls to Content() will return data after the previous call
func (*ConsumeState) Error ¶
func (a *ConsumeState) Error() error
returns the error that occurred during fetching
func (*ConsumeState) IsComplete ¶
func (a *ConsumeState) IsComplete() bool
returns true if the content has been completely fetched
func (*ConsumeState) Name ¶
func (a *ConsumeState) Name() enc.Name
returns the name of the object being consumed
func (*ConsumeState) ProgressMax ¶
func (a *ConsumeState) ProgressMax() int
get the max value for the progress counter (-1 for unknown)
func (*ConsumeState) Version ¶
func (a *ConsumeState) Version() uint64
returns the version of the object being consumed
type FetchWindow ¶
type FetchWindow struct {
Valid int // the position from which the data has been fetched and is valid
Fetching int // the position from which the data is being fetched (window start)
Pending int // the position from which the data is pending to be fetched (end of the current fetching window)
}
FetchWindow holds the state of the fetching window It tracks the progress of data fetching and availability