README Formatting

This commit is contained in:
Sarah Jamie Lewis 2023-02-23 10:14:51 -08:00
parent a4bbda2556
commit 36a21d5cd1
1 changed files with 13 additions and 13 deletions

View File

@ -12,24 +12,24 @@ The current Cwtch Bindings Specification is defined in [spec](./spec)
Supported function prototypes: Supported function prototypes:
* `app <Function Name> <Args>` - an application-level function, called on global `Application` * `app <Function Name> <Args>` - an application-level function, called on global `Application`
* `profile <Function Name> <Args>` - a profile-level function, takes `profile` as an implicit first argument * `profile <Function Name> <Args>` - a profile-level function, takes `profile` as an implicit first argument
* `json(profile) <Function Name> <Args>` - a profile-level function, takes `profile` as an implicit first argument and returns a json blob that must be freed by the calling library * `json(profile) <Function Name> <Args>` - a profile-level function, takes `profile` as an implicit first argument and returns a json blob that must be freed by the calling library
* `@profile-experiment <Function Name> <Experiment> <Args>`- an experimental profile-level function, takes `profile` as an implicit first argument, experiment must implement cwtch Functionality interface * `@profile-experiment <Function Name> <Experiment> <Args>`- an experimental profile-level function, takes `profile` as an implicit first argument, experiment must implement cwtch Functionality interface
* `@(json)profile-experiment <Function Name> <Experiment> <Args>` - am experimental profile-level function, takes `profile` as an implicit first argument and returns a json blob that must be freed by the calling library, , experiment must implement cwtch Functionality interface * `@(json)profile-experiment <Function Name> <Experiment> <Args>` - am experimental profile-level function, takes `profile` as an implicit first argument and returns a json blob that must be freed by the calling library, , experiment must implement cwtch Functionality interface
Supported argument prototypes: Supported argument prototypes:
* `profile` - a cwtch profile identifier * `profile` - a cwtch profile identifier
* `conversation` - a cwtch conversation identifier * `conversation` - a cwtch conversation identifier
* `message` - a cwtch message identifier * `message` - a cwtch message identifier
* `int:<name>` - a generic integer argument (with optional name) * `int:<name>` - a generic integer argument (with optional name)
* `bool:<name>` - a generic boolean argument (with optional name) * `bool:<name>` - a generic boolean argument (with optional name)
* `string:<name>` - a generic string argument (with optional name) * `string:<name>` - a generic string argument (with optional name)
All arguments must be defined in the order they are specified by the underlying Cwtch library function. All arguments must be defined in the order they are specified by the underlying Cwtch library function.
Other directives: Other directives:
* `import <go pkg>` - includes an additional go importin the compiled lib.go (needed for experiments) * `import <go pkg>` - includes an additional go importin the compiled lib.go (needed for experiments)
* Functions that start with `Enhanced` are automatically stripped of that prefix for their binding names e.g. `EnhancedGetMessage` generated a binding `c_GetMessage` - for certain functions Cwtch has two potential calling options `<Function>` and `Enhanced<Function>`. "Enhanced" in this case means that the response is optimised for calling by a user-facing application by e.g. directly making a number of calls under the hood and returning a json blob of the results. * Functions that start with `Enhanced` are automatically stripped of that prefix for their binding names e.g. `EnhancedGetMessage` generated a binding `c_GetMessage` - for certain functions Cwtch has two potential calling options `<Function>` and `Enhanced<Function>`. "Enhanced" in this case means that the response is optimised for calling by a user-facing application by e.g. directly making a number of calls under the hood and returning a json blob of the results.