Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigurationAreEqual(c1 ApplicationConfiguration, c2 ApplicationConfiguration) bool
- func MapApplications(models []*Application) []output.Application
- func MapBranch(model Branch) output.Branch
- func MapCheckoutObject(model CheckoutObject) output.CheckoutObject
- func MapCommand(model Command) output.Command
- func MapForward(model Forward) output.Forward
- func MapMetric(model Metric) output.Metric
- func MapReplacedBy(model *Session) string
- func MapSession(model *Session) *output.Session
- func MapSessionLog(log Log) output.SessionLog
- func MapSessionStatus(model *Session) output.SessionStatus
- func MapSessions(models []*Session) []output.Session
- func MapTag(model Tag) output.Tag
- func NewContextStore(mutexBuilder utils.MutexBuilder) *contextStore
- func NewMetricsForSession(session *Session) func(string) func()
- func NewSessionAlias(exclude []string) string
- type Application
- func (a *Application) AddNotification(notificationType ApplicationNotificationType, description string, ...)
- func (a *Application) GetConfiguration() ApplicationConfiguration
- func (a *Application) GetEventBus() *ApplicationEventBus
- func (a *Application) GetStatus() ApplicationStatus
- func (a *Application) RemoveNotificationByType(notificationType ApplicationNotificationType)
- func (a *Application) SetBaseFolder(baseFolder string)
- func (a *Application) SetConfiguration(conf ApplicationConfiguration)
- func (a *Application) SetFolder(folder string)
- func (a *Application) SetStatus(status ApplicationStatus)
- func (a *Application) ToOutput() output.Application
- func (a *Application) WithLock(f func(*Application))
- func (a *Application) WithRLock(f func(*Application))
- type ApplicationBuilder
- type ApplicationCommand
- type ApplicationCommandOutput
- type ApplicationConfiguration
- func (a *ApplicationConfiguration) OverrideWith(override SharedConfiguration)
- func (a *ApplicationConfiguration) SetAsDefault(def bool) *ApplicationConfiguration
- func (a ApplicationConfiguration) ToOutput() output.ApplicationConfiguration
- func (a *ApplicationConfiguration) WithBranch(branch *BranchConfigurationMatch) *ApplicationConfiguration
- func (a *ApplicationConfiguration) WithCleanCommand(command string) *ApplicationConfiguration
- func (a *ApplicationConfiguration) WithCleanCommand_ContinueOnError(command string) *ApplicationConfiguration
- func (a *ApplicationConfiguration) WithHealthcheckRetryInterval(interval float32) *ApplicationConfiguration
- func (a *ApplicationConfiguration) WithLock(f func(*ApplicationConfiguration))
- func (a *ApplicationConfiguration) WithRLock(f func(*ApplicationConfiguration))
- func (a *ApplicationConfiguration) WithRemote(remote string) *ApplicationConfiguration
- func (a *ApplicationConfiguration) WithStartCommand(command string) *ApplicationConfiguration
- func (a *ApplicationConfiguration) WithStartupRetries(n int) *ApplicationConfiguration
- func (a *ApplicationConfiguration) WithStopCommand(command string) *ApplicationConfiguration
- type ApplicationEvent
- type ApplicationEventBus
- type ApplicationEventType
- type ApplicationNotification
- type ApplicationNotificationLevel
- type ApplicationNotificationType
- type ApplicationStatus
- type Branch
- type BranchConfiguration
- type BranchConfigurationMatch
- type Branches
- type BusEventType
- type CheckoutObject
- type Command
- type Commands
- type CompiledForwardPattern
- type DiagnosticsAction
- type DiagnosticsData
- type Fetch
- type Forward
- type GlobalConfiguration
- type Header
- type Headers
- type Healthcheck
- type Helper
- type HelperPosition
- type KillReason
- type Log
- type LogType
- type Metric
- type Metrics
- type PortConfiguration
- type PrevNextDiagnosticsValue
- type Recycle
- type RemoteObject
- type RequestConfiguration
- type RootConfiguration
- type Session
- func (session *Session) DecreaseMaxAge()
- func (session *Session) GetConfiguration() ApplicationConfiguration
- func (session *Session) GetCreatedAt() time.Time
- func (session *Session) GetDiagnosticsData() []DiagnosticsData
- func (session *Session) GetEventBus() *SessionLifetimeEventBus
- func (session *Session) GetInactiveAt() time.Time
- func (session *Session) GetKillReason() KillReason
- func (session *Session) GetLogs() []Log
- func (session *Session) GetMaxAge() int
- func (session *Session) GetReplacedBy() *Session
- func (session *Session) GetReplaces() []*Session
- func (session *Session) GetStartupRetriesCount() int
- func (session *Session) GetStatus() SessionStatus
- func (session *Session) GetTarget() string
- func (session *Session) IncStartupRetriesCount()
- func (session *Session) InitializeConfiguration()
- func (session *Session) IsAlive() bool
- func (session *Session) LogCritical(message string)
- func (session *Session) LogDebug(message string)
- func (session *Session) LogError(message string)
- func (session *Session) LogInfo(message string)
- func (session *Session) LogStderr(message string)
- func (session *Session) LogStdin(message string)
- func (session *Session) LogStdout(message string)
- func (session *Session) LogTrace(message string)
- func (session *Session) LogWarn(message string)
- func (session *Session) MarkAsBeingRequested()
- func (session *Session) ResetStartupRetriesCount()
- func (session *Session) ResetVariables()
- func (session *Session) SetInactiveAt(at time.Time)
- func (session *Session) SetKillReason(reason KillReason)
- func (session *Session) SetMaxAge(age int)
- func (session *Session) SetReplacedBy(newSession *Session)
- func (session *Session) SetReplaces(replaces []*Session)
- func (session *Session) SetStatus(status SessionStatus)
- func (session *Session) SetVariable(k string, v string)
- func (session *Session) ToOutput() output.Session
- type SessionBuildEvent
- type SessionBuilder
- type SessionEventType
- type SessionLifetimeEventBus
- type SessionStatus
- type SharedConfiguration
- type Startup
- type Tag
- type Variables
- type Warmup
- type Warmups
Constants ¶
const ( ApplicationNotificationTypeGitClone ApplicationNotificationType = "git_clone_error" ApplicationNotificationTypeGitFetch ApplicationNotificationType = "git_fetch_error" ApplicationNotificationLevelCritical ApplicationNotificationLevel = "critical" )
const ( // SessionStatusStarting - When the session is being built SessionStatusStarting SessionStatus = "starting" // SessionStatusStarted - When the session has been built // and the session is available to be proxied to SessionStatusStarted SessionStatus = "started" // SessionStatusStartFailed - When the session build process failed SessionStatusStartFailed SessionStatus = "start_failed" // SessionStatusStopFailed - When the session stop process failed SessionStatusStopFailed SessionStatus = "stop_failed" // SessionStatusStopping - When the session is being stopped SessionStatusStopping SessionStatus = "stopping" // SessionStatusStopped - When the session has been stopped successfully SessionStatusStopped SessionStatus = "stopped" // SessionStatusDegraded - When the healthcheck failed // and the session is NOT available to be proxied to SessionStatusDegraded SessionStatus = "degraded" // LogTypeStdin is the command being executed LogTypeStdin LogType = "stdin" // LogTypeStdout is the output printed on the stdout LogTypeStdout LogType = "stdout" // LogTypeStderr is the output printed on the stderr LogTypeStderr LogType = "stderr" // KillReasonNone - The reason has not been set. Maybe because there has not been a kill yet KillReasonNone KillReason = "" // KillReasonStopped - The session has been manually stopped by the user KillReasonStopped KillReason = "stopped" // KillReasonBuildFailed - The session has been killed because its build process failed KillReasonBuildFailed KillReason = "build_failed" // KillReasonHealthcheckFailed - The session has been killed because the healthcheck process // could not check the service reachability. It depends on user-provided configuration KillReasonHealthcheckFailed KillReason = "healthcheck_failed" // KillReasonReplaced - Means the session is going to be replaced with an updated one KillReasonReplaced KillReason = "replaced" // SessionBuildContextKey is the name of the shared BUILD context. // It is shared to allow an early session destruction to stop a running build of a session SessionBuildContextKey string = "build" )
Variables ¶
var (
ErrMalformedHeader error = errors.New("Malformed header; the format should be key=value")
)
Functions ¶
func ConfigurationAreEqual ¶
func ConfigurationAreEqual(c1 ApplicationConfiguration, c2 ApplicationConfiguration) bool
func MapApplications ¶
func MapApplications(models []*Application) []output.Application
MapApplications converts an application model to an output model
func MapCheckoutObject ¶
func MapCheckoutObject(model CheckoutObject) output.CheckoutObject
func MapCommand ¶
func MapForward ¶
func MapReplacedBy ¶ added in v1.3.0
func MapSession ¶
func MapSessionLog ¶
func MapSessionLog(log Log) output.SessionLog
func MapSessionStatus ¶
func MapSessionStatus(model *Session) output.SessionStatus
MapSessionStatus maps a session to a status output model
func MapSessions ¶
func NewContextStore ¶
func NewContextStore(mutexBuilder utils.MutexBuilder) *contextStore
func NewMetricsForSession ¶
func NewSessionAlias ¶ added in v1.3.0
Types ¶
type Application ¶
type Application struct { utils.RWLocker `json:"-"` Filename string `json:"filename"` Status ApplicationStatus `json:"status"` Folder string `json:"folder"` BaseFolder string `json:"baseFolder"` ObjectsToHashMap map[string]string `json:"-"` HashToObjectsMap map[string]*RemoteObject `json:"-"` BranchesMap map[string]*Branch `json:"branchesMap"` TagsMap map[string]*Tag `json:"tagsMap"` Commits []string `json:"-"` CommitMap map[string]*object.Commit `json:"-"` CompiledForwardPatterns []CompiledForwardPattern `json:"-"` // contains filtered or unexported fields }
func (*Application) AddNotification ¶ added in v1.4.0
func (a *Application) AddNotification(notificationType ApplicationNotificationType, description string, level ApplicationNotificationLevel, permanent bool)
AddNotification adds a notification to the array of notifications to be shown on the client side The notifications are grouped by type, so only the first one gets notified to the final user.
func (*Application) GetConfiguration ¶
func (a *Application) GetConfiguration() ApplicationConfiguration
func (*Application) GetEventBus ¶
func (a *Application) GetEventBus() *ApplicationEventBus
func (*Application) GetStatus ¶
func (a *Application) GetStatus() ApplicationStatus
func (*Application) RemoveNotificationByType ¶ added in v1.4.0
func (a *Application) RemoveNotificationByType(notificationType ApplicationNotificationType)
RemoveNotificationByType removes all notifications by a type
func (*Application) SetBaseFolder ¶
func (a *Application) SetBaseFolder(baseFolder string)
func (*Application) SetConfiguration ¶
func (a *Application) SetConfiguration(conf ApplicationConfiguration)
func (*Application) SetFolder ¶
func (a *Application) SetFolder(folder string)
func (*Application) SetStatus ¶
func (a *Application) SetStatus(status ApplicationStatus)
func (*Application) ToOutput ¶
func (a *Application) ToOutput() output.Application
ToOutput converts this model into an output model
func (*Application) WithLock ¶
func (a *Application) WithLock(f func(*Application))
func (*Application) WithRLock ¶
func (a *Application) WithRLock(f func(*Application))
type ApplicationBuilder ¶
type ApplicationBuilder struct {
// contains filtered or unexported fields
}
func NewApplicationBuilder ¶
func NewApplicationBuilder(mutexBuilder utils.MutexBuilder, logger logging.Logger) *ApplicationBuilder
func (*ApplicationBuilder) Build ¶
func (b *ApplicationBuilder) Build(configuration *ApplicationConfiguration, filename string) (*Application, error)
func (*ApplicationBuilder) BuildConfiguration ¶
func (b *ApplicationBuilder) BuildConfiguration(configuration *ApplicationConfiguration) (*ApplicationConfiguration, error)
type ApplicationCommand ¶
type ApplicationConfiguration ¶
type ApplicationConfiguration struct { utils.RWLocker `json:"-"` ID string `json:"id"` Name string `json:"name"` Hash string `json:"hash"` Fetch Fetch `json:"fetch"` IsDefault bool `yaml:"is_default" json:"isDefault"` MaxConcurrentSessions int `yaml:"max_concurrent_sessions" json:"maxConcurrentSessions"` Branches Branches `yaml:"branches"` UseFolderCopy bool `yaml:"use_folder_copy" json:"useFolderCopy"` CleanOnExit *bool `yaml:"clean_on_exit" json:"cleanOnExit" default:"true"` }
ApplicationConfiguration contains the configuration of the application Usually its retrieval methods override the SharedConfiguration struct with the checkout-specific configuration
func BuildApplicationConfiguration ¶ added in v1.3.0
func BuildApplicationConfiguration(name string) *ApplicationConfiguration
func NewApplicationConfiguration ¶
func NewApplicationConfiguration(configuration *ApplicationConfiguration, mutexBuilder utils.MutexBuilder) (*ApplicationConfiguration, error)
func (*ApplicationConfiguration) OverrideWith ¶
func (a *ApplicationConfiguration) OverrideWith(override SharedConfiguration)
func (*ApplicationConfiguration) SetAsDefault ¶ added in v1.3.0
func (a *ApplicationConfiguration) SetAsDefault(def bool) *ApplicationConfiguration
func (ApplicationConfiguration) ToOutput ¶
func (a ApplicationConfiguration) ToOutput() output.ApplicationConfiguration
ToOutput converts this model into an output model
func (*ApplicationConfiguration) WithBranch ¶ added in v1.3.0
func (a *ApplicationConfiguration) WithBranch(branch *BranchConfigurationMatch) *ApplicationConfiguration
func (*ApplicationConfiguration) WithCleanCommand ¶ added in v1.3.0
func (a *ApplicationConfiguration) WithCleanCommand(command string) *ApplicationConfiguration
func (*ApplicationConfiguration) WithCleanCommand_ContinueOnError ¶ added in v1.3.0
func (a *ApplicationConfiguration) WithCleanCommand_ContinueOnError(command string) *ApplicationConfiguration
func (*ApplicationConfiguration) WithHealthcheckRetryInterval ¶ added in v1.3.0
func (a *ApplicationConfiguration) WithHealthcheckRetryInterval(interval float32) *ApplicationConfiguration
func (*ApplicationConfiguration) WithLock ¶
func (a *ApplicationConfiguration) WithLock(f func(*ApplicationConfiguration))
func (*ApplicationConfiguration) WithRLock ¶
func (a *ApplicationConfiguration) WithRLock(f func(*ApplicationConfiguration))
func (*ApplicationConfiguration) WithRemote ¶ added in v1.3.0
func (a *ApplicationConfiguration) WithRemote(remote string) *ApplicationConfiguration
func (*ApplicationConfiguration) WithStartCommand ¶ added in v1.3.0
func (a *ApplicationConfiguration) WithStartCommand(command string) *ApplicationConfiguration
func (*ApplicationConfiguration) WithStartupRetries ¶ added in v1.3.0
func (a *ApplicationConfiguration) WithStartupRetries(n int) *ApplicationConfiguration
func (*ApplicationConfiguration) WithStopCommand ¶ added in v1.3.0
func (a *ApplicationConfiguration) WithStopCommand(command string) *ApplicationConfiguration
type ApplicationEvent ¶
type ApplicationEvent struct { EventType ApplicationEventType Application *Application EventPayload interface{} }
type ApplicationEventBus ¶
func NewApplicationEventBus ¶
func NewApplicationEventBus(mutexBuilder utils.MutexBuilder, logger logging.Logger) *ApplicationEventBus
func (*ApplicationEventBus) Close ¶
func (b *ApplicationEventBus) Close()
func (*ApplicationEventBus) GetChan ¶
func (b *ApplicationEventBus) GetChan() <-chan ApplicationEvent
func (*ApplicationEventBus) PublishEvent ¶
func (b *ApplicationEventBus) PublishEvent(eventType ApplicationEventType, application *Application, payloadObjects ...interface{})
type ApplicationEventType ¶
type ApplicationEventType string
const ( ApplicationEventTypeNone ApplicationEventType = "none" ApplicationEventTypeInitializationStarted ApplicationEventType = "initialization_started" ApplicationEventTypeInitializationCompleted ApplicationEventType = "initialization_completed" ApplicationEventTypeFetchStarted ApplicationEventType = "fetch_started" ApplicationEventTypeFetchCompleted ApplicationEventType = "fetch_completed" ApplicationEventTypeHotSwap ApplicationEventType = "hot_swap" ApplicationEventTypeAutoStart ApplicationEventType = "auto_start" ApplicationEventTypeSessionBuild ApplicationEventType = "session_build" ApplicationEventTypeSessionBuildFailed ApplicationEventType = "session_build_failed" ApplicationEventTypeSessionBuildSucceeded ApplicationEventType = "session_build_succeeded" ApplicationEventTypeSessionCleaned ApplicationEventType = "session_cleaned" )
func (ApplicationEventType) String ¶
func (t ApplicationEventType) String() string
type ApplicationNotification ¶ added in v1.4.0
type ApplicationNotification struct { UUID string Type ApplicationNotificationType Permanent bool Level ApplicationNotificationLevel Description string CreatedAt time.Time }
func (*ApplicationNotification) ToOutput ¶ added in v1.4.0
func (n *ApplicationNotification) ToOutput() output.ApplicationNotification
type ApplicationNotificationLevel ¶ added in v1.4.0
type ApplicationNotificationLevel string
type ApplicationNotificationType ¶ added in v1.4.0
type ApplicationNotificationType string
type ApplicationStatus ¶
type ApplicationStatus string
var ( ApplicationStatusLoading ApplicationStatus = "loading" ApplicationStatusReady ApplicationStatus = "ready" )
type Branch ¶
type Branch struct {
CheckoutObject
}
type BranchConfiguration ¶
type BranchConfigurationMatch ¶
type BranchConfigurationMatch struct { BranchConfiguration `yaml:",inline"` Test string `yaml:"test"` }
func BuildBranchConfigurationMatch ¶ added in v1.3.0
func BuildBranchConfigurationMatch(branch string) *BranchConfigurationMatch
func (*BranchConfigurationMatch) SetMain ¶ added in v1.3.0
func (c *BranchConfigurationMatch) SetMain(main bool) *BranchConfigurationMatch
func (*BranchConfigurationMatch) SetWatch ¶ added in v1.3.0
func (c *BranchConfigurationMatch) SetWatch(watch bool) *BranchConfigurationMatch
type BusEventType ¶ added in v1.3.0
type BusEventType string
func (BusEventType) String ¶ added in v1.3.0
func (t BusEventType) String() string
type CheckoutObject ¶
type Command ¶
type Command struct { Command string `json:"command"` Environment []string `yaml:"environment,omitempty" json:"environment"` OutputVariable string `yaml:"output_variable,omitempty" json:"outputVariable"` ContinueOnError bool `yaml:"continue_on_error" json:"continueOnError"` WorkingDir string `yaml:"working_dir" json:"workingDir"` StartHealthchecking bool `yaml:"start_healthchecking" json:"startHealthchecking"` Timeout int `json:"timeout"` }
type CompiledForwardPattern ¶
type DiagnosticsAction ¶
type DiagnosticsAction string
const (
DiagnosticsActionReplacement DiagnosticsAction = "replacement"
)
func (DiagnosticsAction) String ¶
func (diagnosticsAction DiagnosticsAction) String() string
type DiagnosticsData ¶
type DiagnosticsData struct { Action DiagnosticsAction When time.Time Field string Value interface{} }
type GlobalConfiguration ¶
type Headers ¶
type Healthcheck ¶
type Healthcheck struct { RequestConfiguration `yaml:",inline"` MaxRetries int `yaml:"max_retries" json:"maxRetries"` RetryInterval float32 `yaml:"retry_interval" json:"retryInterval"` }
type Helper ¶
type Helper struct {
Position HelperPosition `json:"position"`
}
type HelperPosition ¶
type HelperPosition string
func (*HelperPosition) GetStyle ¶
func (p *HelperPosition) GetStyle() (x string, y string)
type KillReason ¶
type KillReason string
KillReason states the reason why a session has been killed
func (KillReason) PreventsRebuild ¶
func (reason KillReason) PreventsRebuild() bool
PreventsRebuild checks if the reason why this session has been killed prevents another build with the same checkout to be built
type Log ¶
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
func NewMetrics ¶
func NewMetrics() *Metrics
type PortConfiguration ¶
type PortConfiguration struct {
Except []int `json:"except"`
}
type Recycle ¶
type Recycle struct {
InactivityTimeout int `yaml:"inactivity_timeout" json:"inactivityTimeout"`
}
type RemoteObject ¶
type RequestConfiguration ¶
type RootConfiguration ¶
type RootConfiguration struct { Global GlobalConfiguration ApplicationConfigurations []*ApplicationConfiguration `yaml:"applications"` }
type Session ¶
type Session struct { utils.RWLocker `json:"-"` UUID string `json:"uuid"` Alias string `json:"alias"` DisplayName string `json:"displayName"` Port int `json:"port"` ApplicationName string `json:"applicationName"` Application *Application `json:"-"` Status SessionStatus `json:"status"` CommitID string `json:"commitID"` // The object to be checked out (branch/tag/commit id) Checkout string `json:"checkout"` Commit object.Commit `json:"commit"` Folder string `json:"folder"` Variables Variables `json:"variables"` Metrics []Metric `json:"metrics"` Context *contextStore `json:"-"` // contains filtered or unexported fields }
Session is a process on which an application is available. When a session is started it gets built starting from a branch, and when all is ready the reverse proxy will start pointing to it.
func (*Session) DecreaseMaxAge ¶
func (session *Session) DecreaseMaxAge()
DecreaseMaxAge decreases the max-age parameter of the session thread-safely
func (*Session) GetConfiguration ¶
func (session *Session) GetConfiguration() ApplicationConfiguration
GetConfiguration allows to retrieve the CURRENT configuration in a thread-safe manner. This configuration gets replaced whenever there's an update by the user. So it is advisable to not store indefinitely this configuration, but to ask for it when needed
func (*Session) GetCreatedAt ¶
func (*Session) GetDiagnosticsData ¶
func (session *Session) GetDiagnosticsData() []DiagnosticsData
func (*Session) GetEventBus ¶
func (session *Session) GetEventBus() *SessionLifetimeEventBus
func (*Session) GetInactiveAt ¶
GetInactiveAt retrieves the inactive-at value for the session thread-safely
func (*Session) GetKillReason ¶
func (session *Session) GetKillReason() KillReason
GetKillReason returns the reason why the session has been killed thread-safely. Returns KillReasonNone if the session has not been killed
func (*Session) GetReplacedBy ¶
GetReplacedBy thread-safely retrieves the UUID of the session by which this session has been replaced
func (*Session) GetReplaces ¶
GetReplaces thread-safely retrieves the session which will be replaced when this session will go online
func (*Session) GetStartupRetriesCount ¶
GetStartupRetriesCount retrieves the current count of startup retries thread-safely
func (*Session) GetStatus ¶
func (session *Session) GetStatus() SessionStatus
GetStatus allows to get the session status thread-safely
func (*Session) IncStartupRetriesCount ¶
func (session *Session) IncStartupRetriesCount()
IncStartupRetriesCount thread-safely increments the current count of startup retries
func (*Session) InitializeConfiguration ¶
func (session *Session) InitializeConfiguration()
InitializeConfiguration gets called whenever a secondary actor knows that application's configuration changed. This allows the session to get its matching configuration
func (*Session) LogCritical ¶
LogCritical logs a message to stdout and stores it in the session logs slice
func (*Session) LogDebug ¶
LogDebug logs a message to stdout and stores it in the session logs slice
func (*Session) LogError ¶
LogError logs a message to stdout and stores it in the session logs slice
func (*Session) LogStderr ¶
LogStderr logs a message to stdout and stores it in the session logs slice
func (*Session) LogStdin ¶
LogStdin logs a message to stdout and stores it in the session logs slice
func (*Session) LogStdout ¶
LogStdout logs a message to stdout and stores it in the session logs slice
func (*Session) LogTrace ¶
LogTrace logs a message to stdout and stores it in the session logs slice
func (*Session) MarkAsBeingRequested ¶
func (session *Session) MarkAsBeingRequested()
MarkAsBeingRequested informs the session that it has been used by a proxy so it must reset its inactivity timer, if available
func (*Session) ResetStartupRetriesCount ¶
func (session *Session) ResetStartupRetriesCount()
ResetStartupRetriesCount thread-safely resets the current count of startup retries
func (*Session) ResetVariables ¶
func (session *Session) ResetVariables()
ResetVariables thread-safely resets the session variables dictionary
func (*Session) SetInactiveAt ¶
SetInactiveAt is the thread-safe setter for InactiveAt
func (*Session) SetKillReason ¶
func (session *Session) SetKillReason(reason KillReason)
SetKillReason allows to set the session kill reason thread-safely
func (*Session) SetMaxAge ¶
SetMaxAge allows to set an exact max-age value for the session thread-safely
func (*Session) SetReplacedBy ¶
SetReplacedBy thread-safely sets the UUID of the session by which this session has been replaced
func (*Session) SetReplaces ¶
SetReplaces thread-safely sets the session which will be replaced when this session will go online
func (*Session) SetStatus ¶
func (session *Session) SetStatus(status SessionStatus)
SetStatus allows to set the session status thread-safely
func (*Session) SetVariable ¶
SetVariable thread-safely sets a variable value into the session variables dictionary
type SessionBuildEvent ¶
type SessionBuildEvent struct { EventType SessionEventType Session *Session }
type SessionBuilder ¶
type SessionBuilder struct {
// contains filtered or unexported fields
}
func NewSessionBuilder ¶
func NewSessionBuilder(mutexBuilder utils.MutexBuilder, logger logging.Logger) *SessionBuilder
func (*SessionBuilder) Build ¶
func (b *SessionBuilder) Build(session *Session) *Session
type SessionEventType ¶
type SessionEventType string
const ( SessionEventTypeBuildStarted SessionEventType = "build_started" SessionEventTypePreparingFolders SessionEventType = "preparing_folders" SessionEventTypePreparingFoldersFailed SessionEventType = "preparing_folders_failed" SessionEventTypeCommandsExecutionStarted SessionEventType = "commands_execution_started" SessionEventTypeCommandsExecutionFailed SessionEventType = "commands_execution_failed" SessionEventTypeWarmupStarted SessionEventType = "warmup_started" SessionEventTypeWarmupFailed SessionEventType = "warmup_failed" SessionEventTypeHealthcheckStarted SessionEventType = "healthcheck_started" SessionEventTypeHealthcheckFailed SessionEventType = "healthcheck_failed" SessionEventTypeHealthcheckSucceded SessionEventType = "healthcheck_succeeded" SessionEventTypeBuildGettingRetried SessionEventType = "build_getting_retried" SessionEventTypeFolderClean SessionEventType = "folder_clean" SessionEventTypeCleanCommandExecution SessionEventType = "clean_command_execution" SessionEventTypeSessionAvailable SessionEventType = "session_available" SessionEventTypeSessionStarted SessionEventType = "session_started" )
func (SessionEventType) String ¶
func (t SessionEventType) String() string
type SessionLifetimeEventBus ¶
func NewSessionBuildEventBus ¶
func NewSessionBuildEventBus(mutexBuilder utils.MutexBuilder) *SessionLifetimeEventBus
func (*SessionLifetimeEventBus) Close ¶
func (b *SessionLifetimeEventBus) Close()
func (*SessionLifetimeEventBus) GetChan ¶
func (b *SessionLifetimeEventBus) GetChan() <-chan SessionBuildEvent
func (*SessionLifetimeEventBus) PublishEvent ¶
func (b *SessionLifetimeEventBus) PublishEvent(eventType SessionEventType, session *Session)
type SessionStatus ¶
type SessionStatus string
SessionStatus is the status of the session
func (SessionStatus) IsAlive ¶
func (status SessionStatus) IsAlive() bool
IsAlive states whether the session is started or about be started
func (SessionStatus) String ¶
func (status SessionStatus) String() string
type SharedConfiguration ¶
type SharedConfiguration struct {}
type Tag ¶
type Tag struct {
CheckoutObject
}
type Variables ¶
Variables are those variables used by a single session. May contain data put by the session build process or the output of build commands
type Warmup ¶
type Warmup struct {
RequestConfiguration `yaml:",inline"`
}
Source Files ¶
- application-builder.go
- application-configuration-builder.go
- application-configuration.go
- application-event-bus.go
- application-mapper.go
- application-notification-mapper.go
- application-notification.go
- application.go
- branch-configuration-builder.go
- branch-configuration.go
- configuration.go
- context-store.go
- diagnostics-data.go
- log.go
- session-aliasing.go
- session-builder.go
- session-event-bus.go
- session-mapper.go
- session-metrics.go
- session.go
- shared-configuration.go