Module manifest
{ "slug": "tournament", "version": "1.0.0", "language": "go", "abi": "rudder_v1", "sdk": "0.1.0", "source": "rudder/tournament@1.0.0", "deps": ["reward"], "config": { "schema": {}, "values": {} }, "resources": { "entries": { "scope": "player", "fields": { "board": { "type": "string", "required": true }, "score": { "type": "number", "required": true } }, "indexes": ["board", "score"] } }, "functions": { "submit": { "trigger": "client" }, "reset": { "trigger": "schedule", "cron": "0 * * * *" }, "resetNow": { "trigger": "admin", "roles": ["admin"] } }, "admin": { "pages": [] }}slug,versionandsdkare required.languageisgo.abimust berudder_v1.depsis a DAG. Install fails on a missing dependency or a cycle. A module can only call functions of modules listed indeps.sourcepoints at the marketplace package. Eject copies the version to a project-owned row; marketplace updates stop. Eject and publishing are available only to allowlisted publisher accounts (early access).resourcesare created on install and dropped on uninstall (with confirmation).scopeisprojectorplayer. Resources have nopermissionsblock: their rows are reachable only from module functions and admin tools, never directly from game clients. See Resources.functionsdeclaretrigger:client,admin,event,scheduleormodule.eventnames the event for event functions, androleslimits admin functions. Do not writeinput,outputorerrors: the build generates them from Go types (see Function schemas).- A
schedulefunction needs a valid 5-field cron expression incron. Publish and dry run reject a package with an invalid or missingcronwith HTTP 400. Schedules run in bothstagingandprod. See Functions runtime. admindescribes the module’s dashboard section:title,icon,order,palette,pages(resource pages withtable,cards,timeline,track,resultsorlistlayouts, detail sections, widgets and hooks), plusplayeranddashboardwidgets. Widget types:stat,action-button,resource-table,markdown,tabs,table,chart,alert,results.samplesare optional starter rows the dashboard can create for the module.
The published package is manifest.json, module.wasm and, for marketplace modules, source.tar. The server checks that the wasm compiles, that it imports only rudder_v1 and the allowed WASI functions, and that the functions it registers match the manifest.
Function schemas
Section titled “Function schemas”rudder module build builds the wasm, calls its describe export and writes functions.<fn>.input, output and errors into dist/manifest.json. A manifest.json that declares any of these fields by hand fails the build. The backend validates call arguments against input.
type SubmitArgs struct { Slug string `json:"slug" rudder:"pattern=^[a-z0-9_]+$"` Score int `json:"score" rudder:"min=0"` Mode string `json:"mode,omitempty" rudder:"enum=best|last"`}
func init() { rudder.Register("submit", rudder.Typed(submit), rudder.Errors("board_not_found"))}rudder.Typedrecords the argument and result types.rudder.Errorsdeclares the module’s error codes; kernel codes (invalid_parameters,forbidden,conflict,internal, …) are never declared.- The
jsontag gives the name and-skips a field. A field withoutomitempty(oromitzero) is required. Embedded structs are flattened, pointers are nullable, slices and arrays are arrays,[]byteis a byte string, maps are objects withadditionalProperties,time.Timeis adate-timestring, andencoding.TextMarshalertypes are strings. any, interfaces,json.RawMessage, otherjson.Marshalertypes and maps ofanyare untyped. Recursive types fail the build.- The
ruddertag lists comma-separated constraints:min,max(numbers),minLength,maxLength,pattern(strings),enum=a|b|c(strings and numbers),format.patterntakes the rest of the tag, so put it last. An invalid tag fails the build with the field name. - Functions with trigger
clientmust be fully typed: an untyped node in the arguments or the result fails the build with its path, for exampleclient function submit input.score is untyped. Other triggers may stay untyped.
The generated schemas are what generated module clients are built from.