Skip to content

Latest commit

 

History

History
40 lines (31 loc) · 571 Bytes

README.md

File metadata and controls

40 lines (31 loc) · 571 Bytes

pipedream-go

package main

import (
	"fmt"

	pd "github.com/PipedreamHQ/pipedream-go"
)

func main() {
	// Access previous step data using pd.Steps
	fmt.Println(pd.Steps)
	
	// Alternatively, unmarshal into a type
	var steps Steps
	pd.MustUnmarshal(&steps)
	fmt.Println(steps.Trigger.Event)

	// Export data using pd.Export
	data := make(map[string]interface{})
	data["name"] = "Luke"
	pd.Export("data", data)
}

type Steps struct {
	Trigger struct {
		Event struct {
			// ...
		} `json:"event"`
	} `json:"trigger"`
}

Tests

go test ./...