mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-01-05 16:19:43 -06:00
* api changes * doc changes * move docs * generated * generate * pkg * backmerge main * revert to main * revert main * race? * remove go tests
36 lines
535 B
Go
36 lines
535 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!",
|
|
},
|
|
)
|
|
// !!
|
|
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|