A
LICENSE
+9,
-0
1@@ -0,0 +1,9 @@
2+MIT License
3+
4+Copyright (c) 2026 Bryan Burke
5+
6+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7+
8+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9+
10+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+8,
-50
1@@ -56,7 +56,8 @@ If you need to build the Rust library from source (e.g., for a different platfor
2
3 1. **Install Rust toolchain:**
4 ```bash
5- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
6+ # TODO: need to install devbox or have rustup available
7+ devbox shell
8 ```
9
10 2. **Clone with submodules and build:**
11@@ -69,28 +70,9 @@ If you need to build the Rust library from source (e.g., for a different platfor
12
13 3. **Cross-compile for all supported platforms:**
14 ```bash
15- make libyrs-cross # Builds for linux-amd64, linux-arm64, freebsd-amd64, freebsd-arm64
16+ make libyrs-cross # Builds for linux-amd64, freebsd-amd64
17 ```
18
19-### macOS
20-
21-macOS does not support fully static binaries due to system requirements. Use dynamic linking:
22-
23-```bash
24-make libyrs
25-go build .
26-```
27-
28-### Windows
29-
30-Windows support requires MinGW-w64:
31-
32-```bash
33-make libyrs
34-set CGO_ENABLED=1
35-go build .
36-```
37-
38 ## Quick Start
39
40 ```go
41@@ -99,7 +81,7 @@ package main
42 import (
43 "fmt"
44 "log"
45-
46+
47 "github.com/BTBurke/ygo"
48 )
49
50@@ -110,14 +92,14 @@ func main() {
51 log.Fatal(err)
52 }
53 defer doc.Destroy()
54-
55+
56 // Get or create a text field
57 txt, err := doc.GetText("content")
58 if err != nil {
59 log.Fatal(err)
60 }
61 defer txt.Destroy()
62-
63+
64 // Insert text within a transaction
65 err = doc.WithWriteTransaction(func(txn *ygo.Transaction) error {
66 txt.Insert(txn, 0, "Hello, collaborative world!")
67@@ -126,7 +108,7 @@ func main() {
68 if err != nil {
69 log.Fatal(err)
70 }
71-
72+
73 // Read the text back
74 var content string
75 err = doc.WithReadTransaction(func(txn *ygo.Transaction) error {
76@@ -137,7 +119,7 @@ func main() {
77 if err != nil {
78 log.Fatal(err)
79 }
80-
81+
82 fmt.Println(content) // "Hello, collaborative world!"
83 }
84 ```
85@@ -190,30 +172,6 @@ doc2.WithWriteTransaction(func(txn *ygo.Transaction) error {
86 })
87 ```
88
89-## API Documentation
90-
91-The library implements standard Go interfaces for seamless integration:
92-
93-- `encoding.BinaryMarshaler` / `encoding.BinaryUnmarshaler` - Document serialization
94-- Callback-based transactions with automatic commit/rollback
95-- Idiomatic Go error handling throughout
96-
97-See the [examples](examples/) directory for more complete usage examples.
98-
99-## Architecture
100-
101-```
102-Go Application
103- ↓ (CGO)
104-ygo (Go bindings)
105- ↓ (FFI)
106-libyrs (Rust static library)
107- ↓
108-y-crdt (Rust CRDT implementation)
109-```
110-
111-The native Rust library is built as a static library and linked into your Go binary.
112-
113 ## Platform Support
114
115 Pre-built static libraries are included for: