Session class

Properties

client → Client
finalinherited
hashCode int
The hash code for this object.
no setterinherited
networkEvents Stream<NetworkEvent>
Stream of network events
no setter
rootStateMonitor StateMonitor
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addUserProvidedPeers(List<String> addrs) Future<void>
Adds peers to connect to.
inherited
bindMetrics(String? addr) Future<void>
inherited
bindNetwork(List<String> addrs) Future<void>
Binds the network listeners to the specified interfaces.
inherited
bindRemoteControl(String? addr) Future<int>
inherited
close() Future<void>
Try to gracefully close connections to peers then close the session.
createRepository({required String path, SetLocalSecret? readSecret, SetLocalSecret? writeSecret, ShareToken? token, bool syncEnabled = false, bool dhtEnabled = false, bool pexEnabled = false}) Future<Repository>
Creates a new repository.
inherited
deleteRepositoryByName(String name) Future<void>
Delete a repository with the given name.
inherited
deriveSecretKey(Password password, PasswordSalt salt) Future<SecretKey>
inherited
findRepository(String name) Future<Repository>
inherited
generatePasswordSalt() Future<PasswordSalt>
inherited
generateSecretKey() Future<SecretKey>
inherited
getCurrentProtocolVersion() Future<int>
Returns our Ouisync protocol version.
inherited
getDefaultBlockExpiration() Future<Duration?>
inherited
getDefaultQuota() Future<StorageSize?>
inherited
getDefaultRepositoryExpiration() Future<Duration?>
inherited
getExternalAddrV4() Future<String?>
inherited
getExternalAddrV6() Future<String?>
inherited
getHighestSeenProtocolVersion() Future<int>
Returns the highest protocol version of all known peers.
inherited
getLocalListenerAddrs() Future<List<String>>
Returns the listener addresses of this Ouisync instance.
inherited
getMetricsListenerAddr() Future<String?>
inherited
getMountRoot() Future<String?>
inherited
getNatBehavior() Future<NatBehavior?>
inherited
getNetworkStats() Future<Stats>
inherited
getPeers() Future<List<PeerInfo>>
Returns info about all known peers (both discovered and explicitly added).
inherited
getRemoteControlListenerAddr() Future<String?>
inherited
getRemoteListenerAddrs(String host) Future<List<String>>
Returns the listener addresses of the specified remote Ouisync instance. Works only if the remote control API is enabled on the remote instance. Typically used with cache servers.
inherited
getRuntimeId() Future<PublicRuntimeId>
Returns the runtime id of this Ouisync instance.
inherited
getShareTokenAccessMode(ShareToken token) Future<AccessMode>
Returns the access mode that the given token grants.
inherited
getShareTokenInfoHash(ShareToken token) Future<String>
Return the info-hash of the repository corresponding to the given token, formatted as hex string.
inherited
getShareTokenSuggestedName(ShareToken token) Future<String>
Returns the suggested name for the repository corresponding to the given token.
inherited
getStateMonitor(List<MonitorId> path) Future<StateMonitorNode?>
inherited
getStoreDir() Future<String?>
inherited
getUserProvidedPeers() Future<List<String>>
inherited
initNetwork(NetworkDefaults defaults) Future<void>
Initializes the network according to the stored configuration. If a particular network parameter is not yet configured, falls back to the given defaults.
inherited
isLocalDiscoveryEnabled() Future<bool>
Is local discovery enabled?
inherited
isPexRecvEnabled() Future<bool>
Checks whether accepting peers discovered on the peer exchange is enabled.
inherited
isPexSendEnabled() Future<bool>
inherited
isPortForwardingEnabled() Future<bool>
Is port forwarding (UPnP) enabled?
inherited
listRepositories() Future<Map<String, Repository>>
inherited
mirrorExists(ShareToken token, String host) Future<bool>
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openRepository({required String path, LocalSecret? localSecret}) Future<Repository>
Opens an existing repository.
inherited
removeUserProvidedPeers(List<String> addrs) Future<void>
Removes peers previously added with Self::session_add_user_provided_peers.
inherited
setDefaultBlockExpiration(Duration? value) Future<void>
inherited
setDefaultQuota(StorageSize? value) Future<void>
inherited
setDefaultRepositoryExpiration(Duration? value) Future<void>
inherited
setLocalDiscoveryEnabled(bool enabled) Future<void>
Enables/disables local discovery.
inherited
setMountRoot(String? path) Future<void>
inherited
setPexRecvEnabled(bool enabled) Future<void>
inherited
setPexSendEnabled(bool enabled) Future<void>
inherited
setPortForwardingEnabled(bool enabled) Future<void>
Enables/disables port forwarding (UPnP).
inherited
setStoreDir(String path) Future<void>
inherited
toString() String
A string representation of this object.
inherited
validateShareToken(String token) Future<ShareToken>
Checks whether the given string is a valid share token.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

create({required String configPath}) Future<Session>
Creates a new session in this process. configPath is a path to a directory where configuration files shall be stored. If it doesn't exists, it will be created.