unison-cli-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Unison.Share.Sync

Synopsis

Get causal hash by path

getCausalHashByPath Source #

Arguments

:: BaseUrl

The Unison Share URL.

-> Path 
-> Cli (Either (SyncError GetCausalHashByPathError) (Maybe HashJWT)) 

Get the causal hash of a path hosted on Unison Share.

data GetCausalHashByPathError Source #

An error occurred when getting causal hash by path.

Constructors

GetCausalHashByPathErrorNoReadPermission Path

The user does not have permission to read this path.

GetCausalHashByPathErrorInvalidRepoInfo Text RepoInfo

The repo info was invalid. (err, repoInfo)

GetCausalHashByPathErrorUserNotFound RepoInfo

The user was not found.

Upload

uploadEntities :: BaseUrl -> RepoInfo -> NESet Hash32 -> (Int -> IO ()) -> Cli (Either (SyncError UploadEntitiesError) ()) Source #

Upload a set of entities to Unison Share. If the server responds that it cannot yet store any hash(es) due to missing dependencies, send those dependencies too, and on and on, until the server stops responding that it's missing anything.

Returns true on success, false on failure (because the user does not have write permission).

Pull/Download

pull Source #

Arguments

:: BaseUrl

The Unison Share URL.

-> Path

The repo+path to pull from.

-> (Int -> IO ())

Callback that's given a number of entities we just downloaded.

-> Cli (Either (SyncError PullError) CausalHash) 

data PullError Source #

An error occurred while pulling code from Unison Share.

Instances

Instances details
Show PullError Source # 
Instance details

Defined in Unison.Share.Sync.Types

downloadEntities Source #

Arguments

:: BaseUrl

The Unison Share URL.

-> RepoInfo

The repo to download from.

-> HashJWT

The hash to download.

-> (Int -> IO ())

Callback that's given a number of entities we just downloaded.

-> Cli (Either (SyncError DownloadEntitiesError) ())