mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-05-05 00:59:41 -05:00
38 lines
549 B
Go
38 lines
549 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
|
|
v1_workflows "github.com/hatchet-dev/hatchet/examples/go/workflows"
|
|
v1 "github.com/hatchet-dev/hatchet/pkg/v1"
|
|
"github.com/joho/godotenv"
|
|
)
|
|
|
|
func event() {
|
|
err := godotenv.Load()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
hatchet, err := v1.NewHatchetClient()
|
|
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
// > Pushing an Event
|
|
err = hatchet.Events().Push(
|
|
context.Background(),
|
|
"simple-event:create",
|
|
v1_workflows.SimpleInput{
|
|
Message: "Hello, World!",
|
|
},
|
|
nil,
|
|
nil,
|
|
)
|
|
// !!
|
|
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|