DittoSyncKit  1.0.0-alpha4
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Ditto.SyncKit.DittoIdentity Struct Reference

Used to identify a given peer in your network. In practice a peer may be a user, a device, or it might be some other entity in your system. More...

Public Member Functions

internal DittoIdentity (string appName, uint siteId)
 

Static Public Member Functions

static DittoIdentity Development (string appName="", uint siteId=0)
 Creates a development identity using the provided app name and site ID. If an app name or site ID isn't provided then the SDK will use generated values for them. More...
 
static DittoIdentity Production (string certificateConfig)
 Creates a production identity using the provided certificate config. More...
 

Public Attributes

readonly DittoIdentityType Type
 The type of the identity. More...
 
readonly string AppName
 The app name. More...
 
readonly uint SiteId
 The site ID. More...
 
readonly string CertificateConfig
 A base64 encoded string representation of a certificate bundle. More...
 

Detailed Description

Used to identify a given peer in your network. In practice a peer may be a user, a device, or it might be some other entity in your system.

You can get up and running quickly by using a development identity and then change to using a production identity when you are preparing to deploying DittoSyncKit to production.

Member Function Documentation

◆ Development()

static DittoIdentity Ditto.SyncKit.DittoIdentity.Development ( string  appName = "",
uint  siteId = 0 
)
inlinestatic

Creates a development identity using the provided app name and site ID. If an app name or site ID isn't provided then the SDK will use generated values for them.

Parameters
appNameUse this to ensure that connections between devices are only established if they share the same app name.
siteIdUse this to identity different users or devices. Site IDs are persisted between sessions when using a development identity. Site IDs should be unique and not reused by different users or devices.
Returns
A DittoIdentity suitable for use in a development environment.

◆ Production()

static DittoIdentity Ditto.SyncKit.DittoIdentity.Production ( string  certificateConfig)
inlinestatic

Creates a production identity using the provided certificate config.

Parameters
certificateConfigA base64 encoded string representation of a certificate bundle.
Returns
A DittoIdentity suitable for use in a production environment.

Member Data Documentation

◆ AppName

readonly string Ditto.SyncKit.DittoIdentity.AppName

The app name.

Use this to ensure that connections between devices are only established if they share the same app name.

Note that this is only set if the identity is a development identity.

◆ CertificateConfig

readonly string Ditto.SyncKit.DittoIdentity.CertificateConfig

A base64 encoded string representation of a certificate bundle.

Note that this is only set if the identity is a production identity.

◆ SiteId

readonly uint Ditto.SyncKit.DittoIdentity.SiteId

The site ID.

Use this to identity different users or devices. Site IDs are persisted between sessions if using a development identity.

Site IDs should be unique and not reused by different users or devices.

///

Note that this is only set if the identity is a development identity.

◆ Type

readonly DittoIdentityType Ditto.SyncKit.DittoIdentity.Type

The type of the identity.