Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Compiled binaries
*.bin
*.so
*.dylib
*.exe
*.log
*.logs
bin/logs/

# Environment files
.env
.env.local
.env.*.local

# Bin directory exclusions
bin/*.bin
bin/main.bin
bin/.env
bin/projects/
bin/project.json
bin/backups/
bin/collections/
bin/temp/
bin/logs/
bin/tmp/
bin/system/


# Allow specific Go and Odin source files
!main/main.odin

# System and IDE files
.DS_Store
.ropeproject
*.key
*.ostrichdb
*project.json
*.claude
*rate_limits
*requests.json
1 change: 1 addition & 0 deletions OstrichDB
Submodule OstrichDB added at 2488c2
114 changes: 0 additions & 114 deletions client/client.go

This file was deleted.

33 changes: 33 additions & 0 deletions main/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module twix-main

go 1.25.3

require ostrichdb-go v0.0.0

require (
client v0.0.0-00010101000000-000000000000 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/charmbracelet/bubbletea v1.3.10 // indirect
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect
github.com/charmbracelet/lipgloss v1.1.0 // indirect
github.com/charmbracelet/x/ansi v0.10.1 // indirect
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect
github.com/charmbracelet/x/term v0.2.1 // indirect
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/termenv v0.16.0 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
golang.org/x/sys v0.36.0 // indirect
golang.org/x/text v0.3.8 // indirect
)

replace client => ../src/client

replace ostrichdb-go => ../ostrichdb-go
2 changes: 2 additions & 0 deletions client/go.sum → main/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQ
github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4=
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
Expand Down
58 changes: 58 additions & 0 deletions main/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package main

import (
"fmt"
"ostrichdb-go/src/lib"
c "client" //uncomment when ready to use client functions
sdk "ostrichdb-go/src/sdk"
)

var config lib.Config = *sdk.NewConfigBuilder()
var client lib.Client = *sdk.NewClientBuilder(&config)
var project lib.Project = *sdk.NewProjectBuilder(&client, "twix")


func main (){
var err error

// START | START | START | START | START | START | START | START | START
// The following code is an example of the flow for creating a
// Project(Dir of Users), Specific User Collection, and a first Post(Cluster)
// Once 'END' is reached an exmaple of another flow begins

err= sdk.CreateProject(&project)
if err != nil {
fmt.Println("Error creating project")
fmt.Println("Error: ",err)
}

// //Note: Whenever implementing user auth on client please replace "Marshall" with username input
collection:= sdk.NewCollectionBuilder(&project, "Marshall")
err = sdk.CreateCollection(collection)

if err != nil {
fmt.Println("Error creating Collection")
fmt.Println("Error: ",err)
}

//Testing things out
currentUser:= c.NewUserBuilder("@Marshall")
//TODO: If there is a space in the string value of Content is not stored. OstrichDB engine issue
newPost:= c.NewPostBuilder(&currentUser, "Hello World")

err = c.HandlePost(*collection, newPost)
if err != nil {
fmt.Println("Error appending new post to a Collection")
fmt.Println("Error: ",err)
}
// END | END| END| END| END| END| END| END| END| END



// Fetching a Post from OstrichDB
specificPost:= sdk.NewClusterBuilder(collection, "Marshall")
fmt.Println(c.FetchPostAuthor(specificPost, 1))
// c.Run()

}

1 change: 1 addition & 0 deletions ostrichdb-go
Submodule ostrichdb-go added at 6cdace
3 changes: 0 additions & 3 deletions server/go.mod

This file was deleted.

Loading