This is a complete set of Stateful Functions for working with web clients that use Foliage
More detailed and complete scheme you can find here
- Import the following package:
import uilib "github.com/foliagecp/ui-app-lib"- Register uilib functions to your Foliage Runtime
runtime, err := statefun.NewRuntime(runtimeCfg)
if err != nil {
...
}
uilib.RegisterAllFunctionTypes(runtime)- Just start Foliage Runtime
runtime.Start(cacheCfg, nil)- Prepare JSON and generate some ID
{
"payload":{
"command": "info"
}
}-
Send request to
ui.ingress.<YOUR_ID>NATS topic via nats cli or from js with our JSON -
Subscribe on
ui.egress.<YOUR_ID>and listen result:
{
"client_id": "<YOUR_ID>",
"creation_time": 1695292826803661600,
"inactivity_timeout": "15m0s",
"last_activity_time": 1695292826803661600,
"life_time": 86400000000000
}For detailed installation instructions and prerequisites, visit the official documentation.
Unless otherwise noted, the easyjson source files are distributed under the Apache Version 2.0 license found in the LICENSE file.
Contributions and bug reports are welcome! Please submit issues or pull requests to help improve this package.
