// Package buildlog reads the builder's log as mesh-delivery's parts that follow it read it: the indexer and the view. package buildlog import ( "encoding/json" "git.novox.be/novox/mesh-sdk/go/delivery" ) // IsBuildEntry says whether an entry of the builder's log is a build's start or end, read from its event alone, so an // entry of another kind (a build's narration, build.said) is passed over before its form is read. One whose event // cannot be read is taken as a build's, so its decoding says what is wrong with it. func IsBuildEntry(value []byte) bool { var e struct { Event *string `json:"event"` } if json.Unmarshal(value, &e) != nil || e.Event == nil { return true } return *e.Event == delivery.BuildStartedEvent || *e.Event == delivery.BuildEndedEvent }