GitHub

Classes

Templates

Rio Classes are defined in template files. A template looks like this:

init: index.init
getState: index.getState
authorizer: index.authorizer
methods:
  - method: sayHello
    inputModel: SayHelloInput
    tag: test
    type: READ
    handler: index.sayHello

API Reference

ParameterTypeRequiredDescription
acceleratedbooleanfalseFlag to decide whether to cache instances or not
authorizerstringfalseDelegate method for authorization. (filename.methodName)
destroystringfalseDelegate method for approving instance deletion. (filename.methodName)
initstringfalseDelegate method for constructor. (filename.methodName)
getstringfalseDelegate method for getting existing instances. (filename.methodName)
getInstanceIdstringfalseDelegate method for generating custom instanceId
getStatestringfalseDelegate method for returning states conditionally
dependenciesstring[]falseCustom dependencies to use in deployment
destinationsstring[]falseCustom destinations to use on state changes
logMasksArray<{ path: string }>falseLog masks. Please see Logs section for more details.
methodsMethod[]falseMethod definitions
descriptionstringfalseDescription to put into the auto-generated documentation.

Handler Model

Most of Rio's delegate methods accept Handler model as well as they accept source code strings.

ParameterTypeRequiredDescription
handlerstringtrueHandler method's path. (filename.methodName)
queryStringModelstringfalseName of the validation model for query strings
inputModelstringfalseName of the validation model for input body
outputModelstringfalseName of the validation model for output body
errorModelstringfalseName of the validation model for error response

Method Model

ParameterTypeRequiredDescription
methodstringtrueName of the method
typeREAD, STATIC, WRITE, QUEUED_WRITEfalseType of the method. Default is WRITE.
descriptionstringfalseDescription to put into the auto-generated documentation.
queryStringModelstringfalseName of the validation model for query strings
inputModelstringfalseName of the validation model for input body
outputModelstringfalseName of the validation model for output body
errorModelstringfalseName of the validation model for error response
handlerstringtrueHandler method's path. (filename.methodName)
schedulestringfalseSchedule rule. It's only available for STATIC methods.
Previous
The Concept