Ditto 4.11.1
 
Loading...
Searching...
No Matches
ditto::SmallPeerInfo Class Reference

The entrypoint for small peer user info collection. More...

Public Member Functions

json metadata () const
 Gets the metadata as JSON.
 
void set_metadata (json metadata) const
 Sets the metadata as user-provided json and is inserted into the small peer info system doc at each collection interval.
 
std::string metadata_json_string () const
 
void set_metadata_json_string (std::string metadata) const
 Sets the metadata as user-provided json string and is inserted into the small peer info system doc at each collection interval.
 
bool is_enabled () const
 Gets a value indicating whether small peer info collection is currently enabled. Defaults to true.
 
void set_enabled (bool enabled) const
 Sets a value indicating whether small peer info collection is currently enabled. Defaults to true.
 
SyncScope sync_scope () const
 Gets "kind" of peers the small peer info will be replicated to.
 
void set_sync_scope (SyncScope sync_scope) const
 Sets which "kind" of peers the small peer info will be replicated to.
 

Detailed Description

The entrypoint for small peer user info collection.

Member Function Documentation

◆ set_metadata()

void ditto::SmallPeerInfo::set_metadata ( json metadata) const

Sets the metadata as user-provided json and is inserted into the small peer info system doc at each collection interval.

The metadata has no schema except for the following constraints:

  1. All contained values must be JSON serializable.
  2. The size of the metadata serialized as JSON may not exceed 128 KB.
  3. The metadata may only be nested up to 64 levels deep.

◆ set_metadata_json_string()

void ditto::SmallPeerInfo::set_metadata_json_string ( std::string metadata) const

Sets the metadata as user-provided json string and is inserted into the small peer info system doc at each collection interval.

The metadata has no schema except for the following constraints:

  1. All contained values must be JSON serializable.
  2. The size of the metadata serialized as JSON may not exceed 128 KB.
  3. The metadata may only be nested up to 64 levels deep.

◆ sync_scope()

SyncScope ditto::SmallPeerInfo::sync_scope ( ) const

Gets "kind" of peers the small peer info will be replicated to.

Default is SyncScope::BigPeerOnly.