- Serverless Design Patterns and Best Practices
- Brian Zambrano
- 241字
- 2021-08-27 19:11:59
Conventions used
There are a number of text conventions used throughout this book.
CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "To test this, we need to set the timeout of the divide function to 4 seconds and put a time.sleep(3) in the middle of the application code."
A block of code is set as follows:
def divide(event, context):
params = event.get('queryStringParameters') or {}
numerator = int(params.get('numerator', 10))
denominator = int(params.get('denominator', 2))
body = {
"message": "Results of %s / %s = %s" % (
numerator,
denominator,
numerator // denominator,
)
}
response = {
"statusCode": 200,
"body": json.dumps(body)
}
return response
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
from raven_python_lambda import RavenLambdaWrapper
@RavenLambdaWrapper()
from raven_python_lambda import RavenLambdaWrapper
@RavenLambdaWrapper()
def divide(event, context):
# Code
Any command-line input or output is written as follows:
$ curl "https://5gj9zthyv1.execute-api.us-west-2.amazonaws.com/dev?numerator=12&denominator=3"
{"message": "Results of 12 / 3 = 4"}
Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "The following screenshot shows Invocation errors from the AWS Lambda monitoring page for the divide function:"
- Visualforce Development Cookbook(Second Edition)
- 大數(shù)據(jù)技術(shù)基礎(chǔ)
- 計(jì)算機(jī)應(yīng)用基礎(chǔ)·基礎(chǔ)模塊
- 程序設(shè)計(jì)缺陷分析與實(shí)踐
- 離散事件系統(tǒng)建模與仿真
- 條碼技術(shù)及應(yīng)用
- 大數(shù)據(jù)安全與隱私保護(hù)
- WordPress Theme Development Beginner's Guide(Third Edition)
- 樂(lè)高機(jī)器人—槍械武器庫(kù)
- Android游戲開(kāi)發(fā)案例與關(guān)鍵技術(shù)
- 基于單片機(jī)的嵌入式工程開(kāi)發(fā)詳解
- Kubernetes for Serverless Applications
- 菜鳥(niǎo)起飛系統(tǒng)安裝與重裝
- 網(wǎng)中之我:何明升網(wǎng)絡(luò)社會(huì)論稿
- 奇點(diǎn)將至