Documentation ¶
Index ¶
- func UnmarshalJSON(b []byte) (messager, error)
- type ArtifactBuildError
- type ArtifactFailedMessage
- type ArtifactMessage
- type ArtifactProgressBody
- type ArtifactProgressMessage
- type ArtifactSucceededMessage
- type BaseMessage
- type BuildError
- type BuildFailedMessage
- type BuildLog
- type BuildLogConnector
- type BuildMessage
- type EventHandlerError
- type Message
- type MessageEnum
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnmarshalJSON ¶
Types ¶
type ArtifactBuildError ¶
type ArtifactBuildError struct { *errs.WrapperError Artifact *buildplan.Artifact Message *ArtifactFailedMessage }
type ArtifactFailedMessage ¶
type ArtifactFailedMessage struct { ArtifactMessage ErrorMessage string `json:"error_message"` LogURI string `json:"log_uri"` }
ArtifactFailedMessage extends an ArtifactMessage with error information
type ArtifactMessage ¶
type ArtifactMessage struct { BaseMessage RecipeID string `json:"recipe_id"` ArtifactID strfmt.UUID `json:"artifact_id"` Timestamp time.Time `json:"timestamp"` // CacheHit indicates if an artifact has been originally built for a different recipe CacheHit bool `json:"cache_hit"` }
ArtifactMessage holds status information for an individual artifact
type ArtifactProgressBody ¶
type ArtifactProgressMessage ¶
type ArtifactProgressMessage struct { BaseMessage ArtifactID strfmt.UUID `json:"artifact_id"` Timestamp string `json:"timestamp"` Source string `json:"source"` PipeName string `json:"pipe_name"` Body ArtifactProgressBody `json:"body"` }
ArtifactProgressMessage forwards detailed logging information send for an artifact
type ArtifactSucceededMessage ¶
type ArtifactSucceededMessage struct { ArtifactMessage ArtifactURI string `json:"artifact_download_uri"` ArtifactChecksum string `json:"artifact_checksum"` ArtifactMIMEType string `json:"artifact_mime_type"` LogURI string `json:"log_uri"` }
ArtifactSucceededMessage extends an ArtifactMessage with information that becomes available after an artifact built successfully
type BaseMessage ¶
type BaseMessage struct {
Type string `json:"type"`
}
func (BaseMessage) MessageType ¶
func (bm BaseMessage) MessageType() MessageEnum
func (BaseMessage) MessageTypeValue ¶
func (bm BaseMessage) MessageTypeValue() string
type BuildError ¶
type BuildError struct {
*locale.LocalizedError
}
BuildError designates a build log build error.
type BuildFailedMessage ¶
type BuildFailedMessage struct { BuildMessage ErrorMessage string `json:"error_message"` }
BuildFailedMessage extends a BuildMessage with an error message
type BuildLog ¶
type BuildLog struct {
// contains filtered or unexported fields
}
BuildLog is an implementation of a build log
func New ¶
func New(recipeID strfmt.UUID, artifactMap buildplan.ArtifactIDMap) *BuildLog
New creates a new BuildLog instance that allows us to wait for incoming build log information artifactMap comprises all artifacts (from the runtime closure) that are in the recipe, alreadyBuilt is set of artifact IDs that have already been built in the past
func (*BuildLog) OnArtifactReady ¶
OnArtifactReady registers a callback function to be called when an artifact is ready Technically this is redundant with the event handler, but since handling artifacts is the main purpose of the buildlog streamer it makes sense to make this an explicit function and make consuming code more readable in the process.
func (*BuildLog) Wait ¶
NewWithCustomConnections creates a new BuildLog instance with all physical connections managed by the caller
func (*BuildLog) WithEventHandler ¶
func (b *BuildLog) WithEventHandler(handler ...events.HandlerFunc) *BuildLog
func (*BuildLog) WithLogFile ¶
type BuildLogConnector ¶
BuildLogConnector describes how to interact with a build log connection
type BuildMessage ¶
type BuildMessage struct { BaseMessage RecipeID string `json:"recipe_id"` Timestamp time.Time `json:"timestamp"` }
BuildMessage comprises status information about a build
type EventHandlerError ¶
type EventHandlerError struct {
*errs.WrapperError
}
EventHandlerError designates an error in the event handler for reporting progress.
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func (*Message) UnmarshalJSON ¶
type MessageEnum ¶
type MessageEnum int
MessageEnum enumerates the build events that can be expected on the buildlog websocket connection
const ( UnknownMessage MessageEnum = iota BuildStarted BuildSucceeded BuildFailed ArtifactStarted ArtifactSucceeded ArtifactFailed ArtifactProgress Heartbeat )