Skip to content

Commit 326de9b

Browse files
committed
update docs for go package modules
1 parent dfae5f6 commit 326de9b

File tree

2 files changed

+164
-176
lines changed

2 files changed

+164
-176
lines changed

README.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Memex is a graph-oriented data management tool.
1212
- **Content-Addressable**: All content stored and referenced by hash for integrity and deduplication
1313
- **Flexible Linking**: Create typed, directional relationships between content
1414
- **Transaction System**: Cryptographic verification of all graph modifications with hash chain
15+
- **Module System**: Extend functionality through Go packages
1516
- **Dual Interface**: Use either CLI tool or web interface
1617
- **Single File Storage**: All data contained in one .mx file for easy backup and portability
1718

@@ -56,6 +57,12 @@ memex delete <id>
5657

5758
# Verify transaction history
5859
memex verify
60+
61+
# List installed modules
62+
memex module list
63+
64+
# Run a module command
65+
memex <module-id> <command> [args...]
5966
```
6067

6168
### Web Interface
@@ -72,6 +79,7 @@ Then visit `http://localhost:3000` to access the web interface, which provides:
7279
- Content search
7380
- Node metadata viewing
7481
- Transaction history viewing
82+
- Module management
7583

7684
## Project Structure
7785

@@ -82,14 +90,14 @@ Then visit `http://localhost:3000` to access the web interface, which provides:
8290
│ └── memexd/ # Web server
8391
├── internal/ # Internal packages
8492
│ └── memex/
85-
│ ├── core/ # Core types
93+
│ ├── core/ # Core types and interfaces
8694
│ ├── storage/ # Storage implementation
8795
│ ├── transaction/ # Transaction system
8896
│ ├── commands.go # CLI commands
8997
│ ├── config.go # Configuration
9098
│ └── editor.go # Text editor
9199
├── pkg/ # Public API
92-
│ └── memex/ # Client library
100+
│ └── module/ # Module system
93101
├── test/ # Test files
94102
└── docs/ # Documentation
95103
```
@@ -122,6 +130,15 @@ Then visit `http://localhost:3000` to access the web interface, which provides:
122130
- Optional metadata/notes on links
123131
- Maintains acyclic property
124132

133+
### Module System
134+
135+
- Extend functionality through Go packages
136+
- Standard interface for all modules
137+
- Built-in base implementation
138+
- Repository operations (nodes, links)
139+
- Command system integration
140+
- Metadata support for module data
141+
125142
### Content Storage
126143

127144
- Content split into chunks:
@@ -155,6 +172,27 @@ go build ./...
155172
go test ./...
156173
```
157174

175+
### Creating Modules
176+
177+
See [Module Guide](docs/MODULE.md) for detailed instructions on creating modules.
178+
179+
Quick example:
180+
```go
181+
package myplugin
182+
183+
import "memex/pkg/module"
184+
185+
type MyModule struct {
186+
*module.Base
187+
}
188+
189+
func New() module.Module {
190+
return &MyModule{
191+
Base: module.NewBase("mymodule", "My Module", "Description"),
192+
}
193+
}
194+
```
195+
158196
### Testing
159197

160198
```bash
@@ -173,6 +211,7 @@ go test ./internal/memex/storage/...
173211
- [API Documentation](docs/API.md): HTTP API endpoints and usage
174212
- [Design Document](docs/DESIGN.md): Architecture and design decisions
175213
- [Development Guide](docs/DEVELOPMENT.md): Setup and contribution guidelines
214+
- [Module Guide](docs/MODULE.md): Creating and using modules
176215
- [Storage Implementation](docs/STORAGE.md): Detailed explanation of the storage system
177216
- [Transaction System](docs/TRANSACTION.md): Graph modification tracking and verification
178217
- [Migration Guide](docs/MIGRATION.md): Graph import/export and content migration
@@ -201,6 +240,7 @@ go test ./internal/memex/storage/...
201240
- Transaction branching and merging
202241
- Distributed verification
203242
- Time travel through graph history
243+
- Additional module types
204244

205245
## License
206246

0 commit comments

Comments
 (0)