-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from platogo/add-documentation
Update documentation
- Loading branch information
Showing
12 changed files
with
315 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
defprotocol CRDT do | ||
@moduledoc """ | ||
Protocol defining the interface for CRDTs. | ||
""" | ||
|
||
@type actor :: term() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,22 @@ | ||
defprotocol CRDT.Access do | ||
@moduledoc """ | ||
This protocol defines the access methods for CRDTs. | ||
""" | ||
@doc """ | ||
Returns the value at the given path. | ||
""" | ||
@spec get_in(t(), nonempty_list(term())) :: term() | ||
def get_in(t, list) | ||
|
||
@doc """ | ||
Adds the given value to the given path. | ||
""" | ||
@spec put_in(t(), term(), nonempty_list(term()), CRDT.crdt()) :: CRDT.crdt() | ||
def put_in(t, actor, list, value) | ||
|
||
@doc """ | ||
Updates the value at the given path. | ||
""" | ||
@spec update_in(t(), term(), nonempty_list(term()), (term() -> term())) :: CRDT.crdt() | ||
def update_in(t, actor, list, fun) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.