Documentation ¶
Index ¶
- Constants
- Variables
- func ConsoleLogger(logs <-chan LogEntry)
- type DeploymentLogger
- func (l *DeploymentLogger) BroadcastLogs()
- func (l *DeploymentLogger) Flush()
- func (l *DeploymentLogger) Log(entry LogEntry)
- func (l *DeploymentLogger) LogCmdFail(origin, cmd string, err error)
- func (l *DeploymentLogger) LogCmdStart(origin, cmd string)
- func (l *DeploymentLogger) LogCmdSuccess(origin, cmd string)
- func (l *DeploymentLogger) LogDeploymentFail(err error)
- func (l *DeploymentLogger) LogDeploymentStart()
- func (l *DeploymentLogger) LogDeploymentSuccess()
- func (l *DeploymentLogger) LogKillReceived()
- func (l *DeploymentLogger) LogStageFail(stage models.DeploymentStage)
- func (l *DeploymentLogger) LogStageResult(msg string)
- func (l *DeploymentLogger) LogStageStart(stage models.DeploymentStage)
- func (l *DeploymentLogger) LogStageSuccess(stage models.DeploymentStage)
- type ExecutionResult
- type Listener
- type LogEntry
- type LogEntryType
- type LogRouter
- type Manager
- type Worker
Constants ¶
View Source
const ( ASCII_RESET = "\x1b[0m" ASCII_BLACK = "\x1b[30m" ASCII_RED = "\x1b[31m" ASCII_GREEN = "\x1b[32m" ASCII_YELLOW = "\x1b[33m" ASCII_BLUE = "\x1b[34m" ASCII_MAGENTA = "\x1b[35m" ASCII_CYAN = "\x1b[36m" ASCII_WHITE = "\x1b[37m" )
Variables ¶
View Source
var ErrNoDeployment = errors.New("no deployment with this ID found")
View Source
var ErrTimeout = errors.New("sending to listener timed out")
View Source
var ListenerTimeout = 200 * time.Millisecond
Functions ¶
func ConsoleLogger ¶
func ConsoleLogger(logs <-chan LogEntry)
Types ¶
type DeploymentLogger ¶
type DeploymentLogger struct {
// contains filtered or unexported fields
}
func NewDeploymentLogger ¶
func NewDeploymentLogger(d *models.Deployment, r *LogRouter) *DeploymentLogger
func (*DeploymentLogger) BroadcastLogs ¶
func (l *DeploymentLogger) BroadcastLogs()
func (*DeploymentLogger) Flush ¶
func (l *DeploymentLogger) Flush()
func (*DeploymentLogger) Log ¶
func (l *DeploymentLogger) Log(entry LogEntry)
func (*DeploymentLogger) LogCmdFail ¶
func (l *DeploymentLogger) LogCmdFail(origin, cmd string, err error)
func (*DeploymentLogger) LogCmdStart ¶
func (l *DeploymentLogger) LogCmdStart(origin, cmd string)
func (*DeploymentLogger) LogCmdSuccess ¶
func (l *DeploymentLogger) LogCmdSuccess(origin, cmd string)
func (*DeploymentLogger) LogDeploymentFail ¶
func (l *DeploymentLogger) LogDeploymentFail(err error)
func (*DeploymentLogger) LogDeploymentStart ¶
func (l *DeploymentLogger) LogDeploymentStart()
func (*DeploymentLogger) LogDeploymentSuccess ¶
func (l *DeploymentLogger) LogDeploymentSuccess()
func (*DeploymentLogger) LogKillReceived ¶
func (l *DeploymentLogger) LogKillReceived()
func (*DeploymentLogger) LogStageFail ¶
func (l *DeploymentLogger) LogStageFail(stage models.DeploymentStage)
func (*DeploymentLogger) LogStageResult ¶
func (l *DeploymentLogger) LogStageResult(msg string)
func (*DeploymentLogger) LogStageStart ¶
func (l *DeploymentLogger) LogStageStart(stage models.DeploymentStage)
func (*DeploymentLogger) LogStageSuccess ¶
func (l *DeploymentLogger) LogStageSuccess(stage models.DeploymentStage)
type ExecutionResult ¶
type ExecutionResult struct {
// contains filtered or unexported fields
}
type LogEntryType ¶
type LogEntryType string
const ( COMMAND_STDOUT_OUTPUT LogEntryType = "COMMAND_STDOUT_OUTPUT" COMMAND_STDERR_OUTPUT LogEntryType = "COMMAND_STDERR_OUTPUT" COMMAND_START LogEntryType = "COMMAND_START" COMMAND_FAIL LogEntryType = "COMMAND_FAIL" COMMAND_SUCCESS LogEntryType = "COMMAND_SUCCESS" STAGE_START LogEntryType = "STAGE_START" STAGE_FAIL LogEntryType = "STAGE_FAIL" STAGE_SUCCESS LogEntryType = "STAGE_SUCCESS" STAGE_RESULT LogEntryType = "STAGE_RESULT" DEPLOYMENT_START LogEntryType = "DEPLOYMENT_START" DEPLOYMENT_SUCCESS LogEntryType = "DEPLOYMENT_SUCCESS" DEPLOYMENT_FAIL LogEntryType = "DEPLOYMENT_FAIL" KILL_RECEIVED LogEntryType = "KILL_RECEIVED" )
type LogRouter ¶
type LogRouter struct { // LogEntries on this channel will be routed to registered listeners Broadcast chan LogEntry // If a deployment is done, the DeploymentId needs to be sent on this channel // so the router can close the listeners target channels // Be sure to only sent here after all Broadcast sends Done chan int // contains filtered or unexported fields }
func NewLogRouter ¶
func NewLogRouter() *LogRouter
func (*LogRouter) SubscribeAll ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(c *models.DeploymentConfig, r *LogRouter, kc chan struct{}) (*Manager, error)
func (*Manager) AnnounceStart ¶
func (m *Manager) AnnounceStart()
Starts the broadcasting of LogEntries with the DeploymentLogger and logs the start of the deployment
Click to show internal directories.
Click to hide internal directories.