create

suspend fun create(session: Session, path: String, readSecret: SetLocalSecret?, writeSecret: SetLocalSecret?, shareToken: ShareToken? = null): Repository

Creates a new repository.

Parameters

session

the Ouisync session.

path

path to the local file to store the repository in. It's recommended to use the "ouisyncdb" file extension, but any extension works.

readSecret

local secret for reading the repository on this device only. Do not share with peers!. If null, the repo won't be protected and anyone with physical access to the device will be able to read it.

writeSecret

local secret for writing to the repository on this device only. Do not share with peers! Can be the same as readSecret if one wants to use only one secret for both reading and writing. Separate secrets are useful for plausible deniability. If both readSecret and writeSecret are null, the repo won't be protected and anyone with physical access to the device will be able to read and write to it. If readSecret is not null but writeSecret is null, the repo won't be writable from this device.

shareToken

used to share repositories between devices. If not null, this repo will be linked with the repos with the same share token on other devices. See also createShareToken. This also determines the maximal access mode the repo can be opened in. If null, it's write mode.