Stream build events (SSE)
client.Builds.Events(ctx, id, query) (*BuildEvent, error)
/builds/{id}/events
Streams build events as Server-Sent Events. Events include:
log: Build log lines with timestamp and contentstatus: Build status changes (queued→building→pushing→ready/failed)heartbeat: Keep-alive events sent every 30s to prevent connection timeouts
Returns existing logs as events, then continues streaming if follow=true.
Parameters
id string
Returns
Stream build events (SSE)
package main
import (
"context"
"fmt"
"github.com/kernel/hypeman-go"
"github.com/kernel/hypeman-go/option"
)
func main() {
client := hypeman.NewClient(
option.WithAPIKey("My API Key"),
)
stream := client.Builds.EventsStreaming(
context.TODO(),
"id",
hypeman.BuildEventsParams{
},
)
if stream.Err() != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", buildEvent.Timestamp)
}