第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

無法以編程方式調(diào)用 AWS lambda

無法以編程方式調(diào)用 AWS lambda

Go
斯蒂芬大帝 2023-06-26 15:44:53
我正在導(dǎo)入 lambda 服務(wù),如下所示:import (    lambdaservice "github.com/aws/aws-sdk-go/service/lambda")并按如下方式使用它:func InvokeCreateSessionLambda(payload invoketypes.Input) {    l := &lambdaservice.Lambda{}    data, _ := json.Marshal(payload)    input := &lambdaservice.InvokeInput{        Payload:        data,        InvocationType: aws.String("RequestResponse"),        FunctionName:   aws.String("MyValidFunctionARN"),        ClientContext:  aws.String("{\"service\":\"somedata\"}"),    }    err := input.Validate()    fmt.Println(err) // prints  <nil>    r, e := l.Invoke(input) <panic>    fmt.Print(e)    fmt.Print(r)}但l.Invoke(input)對(duì)(相關(guān))堆棧跟蹤感到恐慌:runtime error: invalid memory address or nil pointer dereference<skipped some lines>panic(0xac91e0, 0x1214ef0)    /usr/local/go/src/runtime/panic.go:522 +0x1b5test-lambda-go/vendor/github.com/aws/aws-sdk-go/aws/client.(*Client).NewRequest(...)    /home/ayush/projects/gojects/src/test-lambda-go/vendor/github.com/aws/aws-sdk-go/aws/client/client.go:84test-lambda-go/vendor/github.com/aws/aws-sdk-go/service/lambda.(*Lambda).newRequest(0xc000107498, 0xc0001f0680, 0xb22ac0, 0xc0001f0640, 0xb12080, 0xc0001f06c0, 0xc0000e2480)    /home/ayush/projects/gojects/src/test-lambda-go/vendor/github.com/aws/aws-sdk-go/service/lambda/service.go:87 +0x3etest-lambda-go/vendor/github.com/aws/aws-sdk-go/service/lambda.(*Lambda).InvokeRequest(0xc000107498, 0xc0001f0640, 0x6, 0xc0001fa000)    /home/ayush/projects/gojects/src/test-lambda-go/vendor/github.com/aws/aws-sdk-go/service/lambda/api.go:1895 +0x102test-lambda-go/vendor/github.com/aws/aws-sdk-go/service/lambda.(*Lambda).Invoke(0xc000107498, 0xc0001f0640, 0xc0001074c0, 0x1, 0x1)    /home/ayush/projects/gojects/src/test-lambda-go/vendor/github.com/aws/aws-sdk-go/service/lambda/api.go:2017 +0x35知道導(dǎo)致錯(cuò)誤的原因以及如何解決此問題嗎?
查看完整描述

1 回答

?
一只斗牛犬

TA貢獻(xiàn)1784條經(jīng)驗(yàn) 獲得超2個(gè)贊

嘗試使用包New中的函數(shù)lambda。


sess := session.Must(session.NewSessionWithOptions(session.Options{

    SharedConfigState: session.SharedConfigEnable,

}))


client := lambda.New(sess, &aws.Config{Region: aws.String("us-west-2")})


查看完整回答
反對(duì) 回復(fù) 2023-06-26
  • 1 回答
  • 0 關(guān)注
  • 222 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)