cat.py 940 B

12345678910111213141516171819202122232425262728293031323334
  1. import handleManager
  2. def support(event):
  3. return True
  4. def handle(faas__request_wrap):
  5. def log(msg):
  6. log_content = faas__request_wrap.setdefault('log', [])
  7. log_content.append("{}/n".format(msg))
  8. # 取出参数和输入上下文
  9. params = faas__request_wrap[handleManager.const_key_params]
  10. context = faas__request_wrap[handleManager.const_key_context]
  11. # log("函数调用参数:\n{}".format(params))
  12. # log("函数运行上下文环境变量:\n{}".format(context))
  13. #--------------------------------------------------------------------
  14. # 这里添加函数处理逻辑
  15. #--------------------------------------------------------------------
  16. context['newKey'] = "I am a new Key!"
  17. # --------------------------------------------------------------------
  18. #
  19. # --------------------------------------------------------------------
  20. result = {}
  21. return result