-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from metrico/dep_replace
fix: to / wideTo
- Loading branch information
Showing
10 changed files
with
223 additions
and
327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"github.com/metrico/fluxpipe/service" | ||
|
||
"github.com/aws/aws-lambda-go/lambda" | ||
) | ||
|
||
var APPNAME = "fluxpipe-lambda" | ||
|
||
func exec(ctx context.Context, inputString string) (string, string) { | ||
res, err := service.RunE(ctx, inputString) | ||
return res, err.Error() | ||
} | ||
|
||
type FluxEvent struct { | ||
Query string `json:"flux"` | ||
} | ||
|
||
func HandleRequest(ctx context.Context, flux FluxEvent) (string, error) { | ||
buf, _ := exec(ctx, flux.Query) | ||
return buf, nil | ||
} | ||
|
||
func main() { | ||
lambda.Start(HandleRequest) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package main | ||
|
||
import ( | ||
"C" | ||
"context" | ||
"fmt" | ||
_ "github.com/InfluxCommunity/flux/fluxinit/static" | ||
"github.com/metrico/fluxpipe/service" | ||
) | ||
|
||
// # CGO_ENABLED=1 go build -buildmode=c-shared -o fluxpipe.a fluxpipelib.go | ||
// # CGO_ENABLED=1 go build -buildmode=c-archive -o fluxpipe.a fluxpipelib.go | ||
|
||
var APPNAME = "fluxpipe-library" | ||
|
||
//export Query | ||
func Query(query string) string { | ||
res, err := service.RunE(context.Background(), query) | ||
if err != nil { | ||
return fmt.Sprintf(`{"code":"invalid","message":"%v"}`, err.Error()) | ||
} | ||
return res | ||
} | ||
|
||
func main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.