You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returns an slice of ordered results of scraped URLs of images
can be deployed as microservice of aws lambda behind aws api gateway
// to test locallypackage main
import (
"context""fmt""github.com/aws/aws-lambda-go/events""github.com/brian-goo/goroutine-like-promise/scrape""github.com/brian-goo/goroutine-like-promise/scrape/lambdaio"
)
funcmain() {
varc context.Contextpost:=` {"urls": ["https://www.yomiuri.co.jp/national/20210628-OYT1T50097/", "http://www.asahi.com/articles/ASP6X4640P6XUNHB001.html"]} `res, _:=scrape.Handler(c, events.APIGatewayProxyRequest{Body: post})
js, _:=lambdaio.Encode(res)
fmt.Printf("%s\n", js)
}
// to use with aws lambda main funcpackage main
import (
"github.com/brian-goo/goroutine-like-promise/scrape""github.com/aws/aws-lambda-go/lambda"
)
funcmain() {
lambda.Start(scrape.Handler)
}