Documentation
¶
Index ¶
- Variables
- 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 BoltStore
- func (s *BoltStore) Begin() (ndn.Store, error)
- func (s *BoltStore) Close() error
- func (s *BoltStore) Commit() error
- func (s *BoltStore) Get(name enc.Name, prefix bool) (wire []byte, err error)
- func (s *BoltStore) Put(name enc.Name, version uint64, wire []byte) error
- func (s *BoltStore) Remove(name enc.Name, prefix bool) error
- func (s *BoltStore) Rollback() error
- type CachingStore
- func (s *CachingStore) Begin() (ndn.Store, error)
- func (s *CachingStore) Close() error
- func (s *CachingStore) Commit() error
- func (s *CachingStore) Flush() error
- func (s *CachingStore) Get(name enc.Name, prefix bool) ([]byte, error)
- func (s *CachingStore) Put(name enc.Name, version uint64, wire []byte) error
- func (s *CachingStore) Remove(name enc.Name, prefix bool) error
- func (s *CachingStore) Rollback() error
- func (s *CachingStore) String() string
- type Client
- func (c *Client) Consume(name enc.Name, callback func(status ndn.ConsumeState))
- func (c *Client) ConsumeExt(args ndn.ConsumeExtArgs)
- func (c *Client) Engine() ndn.Engine
- 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)
- 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 MemoryFifoDir
- type MemoryStore
- func (s *MemoryStore) Begin() (ndn.Store, error)
- func (s *MemoryStore) Commit() error
- func (s *MemoryStore) Get(name enc.Name, prefix bool) ([]byte, error)
- func (s *MemoryStore) MemSize() int
- func (s *MemoryStore) Put(name enc.Name, version uint64, wire []byte) error
- func (s *MemoryStore) Remove(name enc.Name, prefix bool) error
- func (s *MemoryStore) Rollback() error
Constants ¶
This section is empty.
Variables ¶
var BoltBucket = []byte("data")
var ErrBoltNoBucket = errors.New("no bucket in bolt")
Functions ¶
func ExpressR ¶ added in v1.5.0
func ExpressR(engine ndn.Engine, args ndn.ExpressRArgs)
Express a single interest with reliability
Types ¶
type BoltStore ¶
type BoltStore struct {
// contains filtered or unexported fields
}
Store implementation using bbolt Internally it uses a single bucket to store all data Internal storage format is not stable. Do not rely on it. Note: insertions to bolt are comically slow unless batched.
The key is the name of the object as a TLV encoded byte slice The value is the 8-byte version (big endian), followed by data wire
func NewBoltStore ¶
type CachingStore ¶ added in v1.5.0
type CachingStore struct {
// contains filtered or unexported fields
}
CachingStore is a store that caches objects from another store.
func NewCachingStore ¶ added in v1.5.0
func NewCachingStore(store ndn.Store) *CachingStore
NewCachingStore creates a new caching store.
func (*CachingStore) Close ¶ added in v1.5.0
func (s *CachingStore) Close() error
func (*CachingStore) Commit ¶ added in v1.5.0
func (s *CachingStore) Commit() error
func (*CachingStore) Flush ¶ added in v1.5.0
func (s *CachingStore) Flush() error
Flush flushes the cache.
func (*CachingStore) Remove ¶ added in v1.5.0
func (s *CachingStore) Remove(name enc.Name, prefix bool) error
func (*CachingStore) Rollback ¶ added in v1.5.0
func (s *CachingStore) Rollback() error
func (*CachingStore) String ¶ added in v1.5.0
func (s *CachingStore) String() string
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
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 ¶ added in v1.4.3
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) ExpressR ¶
func (c *Client) ExpressR(args ndn.ExpressRArgs)
Express a single interest with reliability
func (*Client) IsCongested ¶ added in v1.5.0
IsCongested returns true if the client is congested
func (*Client) LatestLocal ¶ added in v1.5.0
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 ¶ added in v1.4.3
SuggestSigner returns the signer for a given name nil is returned if no signer is found
func (*Client) ValidateExt ¶ added in v1.4.3
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) Cancel ¶ added in v1.5.0
func (a *ConsumeState) Cancel()
cancel the consume operation
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 ¶ added in v1.5.0
func (a *ConsumeState) Version() uint64
returns the version of the object being consumed
type MemoryFifoDir ¶ added in v1.4.3
type MemoryFifoDir struct {
// contains filtered or unexported fields
}
MemoryFifoDir is a simple object directory that evicts the oldest name when it reaches its size size.
func NewMemoryFifoDir ¶ added in v1.4.3
func NewMemoryFifoDir(size int) *MemoryFifoDir
NewMemoryFifoDir creates a new directory.
func (*MemoryFifoDir) Count ¶ added in v1.4.3
func (d *MemoryFifoDir) Count() int
Count returns the number of names in the directory.
func (*MemoryFifoDir) Evict ¶ added in v1.4.3
func (d *MemoryFifoDir) Evict(client ndn.Client) error
Evict removes old names from a client until it reaches the desired size.
func (*MemoryFifoDir) Pop ¶ added in v1.4.3
func (d *MemoryFifoDir) Pop() enc.Name
Pop removes the oldest name from the directory and returns it. If the directory has not reached its size, it returns nil. It is recommended to use Evict() instead to remove objects from a client.
func (*MemoryFifoDir) Push ¶ added in v1.4.3
func (d *MemoryFifoDir) Push(name enc.Name)
Push adds a name to the directory.
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
func (*MemoryStore) Commit ¶
func (s *MemoryStore) Commit() error
func (*MemoryStore) MemSize ¶ added in v1.4.3
func (s *MemoryStore) MemSize() int
func (*MemoryStore) Rollback ¶
func (s *MemoryStore) Rollback() error