This commit is contained in:
2025-09-13 16:26:25 +02:00
parent 6c9f4b54e0
commit aa44716264
39 changed files with 444 additions and 237 deletions

View File

@@ -0,0 +1,18 @@
#!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run
import freeflowuniverse.herolib.hero.heromodels
mut mydb := heromodels.new()!
mut o := mydb.comments.new(comment: 'Hello, world!')!
o.tags = mydb.comments.db.tags_get(['tag1', 'tag2'])!
oid := mydb.comments.set(o)!
mut o2 := mydb.comments.get(oid)!
println(oid)
println(o2)
mut objects := mydb.comments.list()!
println(objects)

View File

@@ -9,17 +9,17 @@ fn main() {
mut handler := openrpc.new_heromodels_handler()!
my_calendar := heromodels.calendar_new(
name: "My Calendar"
description: "My Calendar"
name: 'My Calendar'
description: 'My Calendar'
securitypolicy: 1
tags: ["tag1", "tag2"]
group_id: 1,
events: []u32{},
color: "#000000",
timezone: "UTC",
is_public: true,
tags: ['tag1', 'tag2']
group_id: 1
events: []u32{}
color: '#000000'
timezone: 'UTC'
is_public: true
)!
response := handler.handle(jsonrpc.new_request('calendar_set', json.encode(my_calendar)))!
println(response)
}
}