implement mcc baobab generation example

This commit is contained in:
Timur Gordon
2025-03-17 01:25:26 +01:00
parent bd3abade55
commit c47002430e
5 changed files with 1999 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
#!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run
import freeflowuniverse.herolib.baobab.generator
import freeflowuniverse.herolib.baobab.specification
import freeflowuniverse.herolib.schemas.openapi
import os
const example_dir = os.join_path('${os.home_dir()}/code/github/freeflowuniverse/herolib/lib/circles/mcc', 'baobab')
const openapi_spec_path = os.join_path('${os.home_dir()}/code/github/freeflowuniverse/herolib/lib/circles/mcc', 'openapi.json')
// the actor specification obtained from the OpenRPC Specification
openapi_spec := openapi.new(path: openapi_spec_path)!
actor_spec := specification.from_openapi(openapi_spec)!
actor_module := generator.generate_actor_module(
actor_spec,
interfaces: [.openapi, .http]
)!
actor_module.write(example_dir,
format: true
overwrite: true
compile: false
)!

View File

@@ -1,3 +1,4 @@
methods.v
meeting_scheduler_actor
generate_actor_module
src

View File

@@ -25,4 +25,4 @@ actor_module.write(example_dir,
compile: false
)!
os.execvp('bash', ['${example_dir}/meeting_scheduler_actor/scripts/run.sh'])!
// os.execvp('bash', ['${example_dir}/meeting_scheduler_actor/scripts/run.sh'])!

1
lib/circles/mcc/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
baobab

1972
lib/circles/mcc/openapi.json Normal file

File diff suppressed because it is too large Load Diff