buildlog

package
v0.0.0-...-7426b64 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnmarshalJSON

func UnmarshalJSON(b []byte) (messager, error)

Types

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 artifact.ArtifactID `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 ArtifactProgressBody struct {
	Facility string `json:"facility"`
	Message  string `json:"msg"`
}

type ArtifactProgressMessage

type ArtifactProgressMessage struct {
	BaseMessage
	ArtifactID artifact.ArtifactID  `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(ctx context.Context, artifactMap artifact.Map, eventHandler events.Handler, recipeID strfmt.UUID, logFilePath string, buildResult *model.BuildResult) (*BuildLog, error)

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 NewWithCustomConnections

func NewWithCustomConnections(artifactMap artifact.Map,
	conn BuildLogConnector, eventHandler events.Handler,
	recipeID strfmt.UUID, logFilePath string) (*BuildLog, error)

NewWithCustomConnections creates a new BuildLog instance with all physical connections managed by the caller

func (*BuildLog) BuiltArtifactsChannel

func (bl *BuildLog) BuiltArtifactsChannel() <-chan artifact.ArtifactDownload

BuiltArtifactsChannel returns the channel to listen for downloadable artifacts on

func (*BuildLog) Close

func (bl *BuildLog) Close() error

func (*BuildLog) Wait

func (bl *BuildLog) Wait() error

Wait waits for the build log to close because the build is done and all downloadable artifacts are here

type BuildLogConnector

type BuildLogConnector interface {
	ReadJSON(interface{}) error
	WriteJSON(interface{}) error
}

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 Events

type Events interface {
	BuildStarting(total int)
	BuildFinished()
	ArtifactBuildStarting(artifactID artifact.ArtifactID)
	ArtifactBuildCached(artifactID artifact.ArtifactID, logURI string)
	ArtifactBuildCompleted(artifactID artifact.ArtifactID, logURI string)
	ArtifactBuildFailed(artifactID artifact.ArtifactID, logURI string, errorMessage string)
	ArtifactBuildProgress(artifact artifact.ArtifactID, timestamp string, message string, facility, pipeName, source string)
	Heartbeat(time.Time)
}

type Message

type Message struct {
	// contains filtered or unexported fields
}

func (*Message) UnmarshalJSON

func (m *Message) UnmarshalJSON(b []byte) error

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
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL