Documentation ¶
Index ¶
- Variables
- func IDsForInfos(infos []ContainerInfo) []container.ID
- func ManifestTargetEndpoints(mt *ManifestTarget) (endpoints []string)
- func NewLogActionLogger(ctx context.Context, dispatch func(action Action)) logger.Logger
- func StateToView(s EngineState) view.View
- type Action
- type AnalyticsNudgeSurfacedAction
- type AnalyticsOptAction
- type BuildResult
- func NewDockerComposeDeployResult(id model.TargetID, containerID container.ID) BuildResult
- func NewImageBuildResult(id model.TargetID, image reference.NamedTagged) BuildResult
- func NewK8sDeployResult(id model.TargetID, uids []types.UID) BuildResult
- func NewLiveUpdateBuildResult(id model.TargetID, containerIDs []container.ID) BuildResult
- type BuildResultSet
- type BuildState
- func (b BuildState) FilesChanged() []string
- func (b BuildState) HasImage() bool
- func (b BuildState) IsEmpty() bool
- func (b BuildState) LastImageAsString() string
- func (b BuildState) NeedsImageBuild() bool
- func (b BuildState) OneContainerInfo() ContainerInfo
- func (b BuildState) WithRunningContainers(cInfos []ContainerInfo) BuildState
- type BuildStateSet
- type BuildStatus
- type Container
- type ContainerInfo
- type DirtyBit
- type DirtyStartToken
- type EngineState
- func (e *EngineState) BuildStatus(id model.TargetID) BuildStatus
- func (s EngineState) DockerComposeConfigPath() []string
- func (e EngineState) IsEmpty() bool
- func (e EngineState) LastTiltfileError() error
- func (e EngineState) Manifest(mn model.ManifestName) (model.Manifest, bool)
- func (e *EngineState) ManifestNamesForTargetID(id model.TargetID) []model.ManifestName
- func (e EngineState) ManifestState(mn model.ManifestName) (*ManifestState, bool)
- func (e EngineState) ManifestStates() []*ManifestState
- func (e EngineState) Manifests() []model.Manifest
- func (e EngineState) RelativeTiltfilePath() (string, error)
- func (e EngineState) Targets() []*ManifestTarget
- func (e *EngineState) UpsertManifestTarget(mt *ManifestTarget)
- type ErrorAction
- type K8sEventAction
- type K8sRuntimeState
- type LocalRuntimeState
- type LogAction
- type LogActionsFlag
- type LogEvent
- type ManifestState
- func (ms *ManifestState) ActiveBuild() model.BuildRecord
- func (ms *ManifestState) AddCompletedBuild(bs model.BuildRecord)
- func (ms *ManifestState) BuildStatus(id model.TargetID) BuildStatus
- func (ms *ManifestState) DCRuntimeState() dockercompose.State
- func (ms *ManifestState) GetOrCreateK8sRuntimeState() K8sRuntimeState
- func (ms *ManifestState) HasPendingChanges() (bool, time.Time)
- func (ms *ManifestState) HasPendingChangesBefore(highWaterMark time.Time) (bool, time.Time)
- func (ms *ManifestState) HasPendingFileChanges() bool
- func (ms *ManifestState) IsDC() bool
- func (ms *ManifestState) IsK8s() bool
- func (ms *ManifestState) IsPendingTime(t time.Time) bool
- func (ms *ManifestState) K8sRuntimeState() K8sRuntimeState
- func (ms *ManifestState) LastBuild() model.BuildRecord
- func (ms *ManifestState) MostRecentPod() Pod
- func (ms *ManifestState) MutableBuildStatus(id model.TargetID) *BuildStatus
- func (ms *ManifestState) NextBuildReason() model.BuildReason
- func (ms *ManifestState) StartedFirstBuild() bool
- func (ms *ManifestState) TargetID() model.TargetID
- type ManifestTarget
- type Pod
- type PodResetRestartsAction
- type RStore
- type Reducer
- type RuntimeState
- type SetUpper
- type Store
- func (s *Store) AddSubscriber(ctx context.Context, sub Subscriber)
- func (s *Store) Close()
- func (s *Store) Dispatch(action Action)
- func (s *Store) LockMutableStateForTesting() *EngineState
- func (s *Store) Loop(ctx context.Context) error
- func (s *Store) NotifySubscribers(ctx context.Context)
- func (s *Store) RLockState() EngineState
- func (s *Store) RUnlockState()
- func (s *Store) RemoveSubscriber(ctx context.Context, sub Subscriber) error
- func (s *Store) SetUpSubscribersForTesting(ctx context.Context)
- func (s *Store) UnlockMutableState()
- type Subscriber
- type SubscriberLifecycle
- type TearDowner
- type TestingStore
- type TiltCloudUserLookedUpAction
- type UIDSet
- type UserStartedTiltCloudRegistrationAction
- type YAMLManifestState
Constants ¶
This section is empty.
Variables ¶
var BuildStateClean = BuildState{}
var EmptyReducer = Reducer(func(ctx context.Context, s *EngineState, action Action) {})
Functions ¶
func IDsForInfos ¶ added in v0.9.7
func IDsForInfos(infos []ContainerInfo) []container.ID
func ManifestTargetEndpoints ¶ added in v0.5.0
func ManifestTargetEndpoints(mt *ManifestTarget) (endpoints []string)
func NewLogActionLogger ¶ added in v0.8.9
func StateToView ¶
func StateToView(s EngineState) view.View
Types ¶
type Action ¶
type Action interface {
Action()
}
func AssertNoActionOfType ¶ added in v0.8.10
for use by tests (with a real channel-based store, NOT a TestingStore). Assert that we don't see an action of the given type
func WaitForAction ¶ added in v0.8.1
for use by tests (with a real channel-based store, NOT a TestingStore), to wait until an action of the specified type comes out of the given chan at some point we might want it to return the index it was found at, and then take an index, so that we can start searching from the next index
type AnalyticsNudgeSurfacedAction ¶ added in v0.8.7
type AnalyticsNudgeSurfacedAction struct{}
func (AnalyticsNudgeSurfacedAction) Action ¶ added in v0.8.7
func (AnalyticsNudgeSurfacedAction) Action()
type AnalyticsOptAction ¶ added in v0.8.4
func (AnalyticsOptAction) Action ¶ added in v0.8.4
func (AnalyticsOptAction) Action()
type BuildResult ¶
type BuildResult struct { // The image target that this built. TargetID model.TargetID // The name+tag of the image that the pod is running. // // The tag is derived from a content-addressable digest. Image reference.NamedTagged // The ID of the container that Docker Compose created. // // When we deploy a Docker Compose service, we wait synchronously for the // container to start. Note that this is a different concurrency model than // we use for Kubernetes, where the pods appear some time later via an // asynchronous event. DockerComposeContainerID container.ID // The ID of the container(s) that we live-updated in-place. // // The contents of the container have diverged from the image it's built on, // so we need to keep track of that. LiveUpdatedContainerIDs []container.ID // The UIDs that we deployed to a Kubernetes cluster. DeployedUIDs []types.UID }
The results of a successful build. TODO(nick): This should probably be implemented as different typer per targetID type
func NewDockerComposeDeployResult ¶ added in v0.10.0
func NewDockerComposeDeployResult(id model.TargetID, containerID container.ID) BuildResult
For docker compose deploy targets.
func NewImageBuildResult ¶ added in v0.7.11
func NewImageBuildResult(id model.TargetID, image reference.NamedTagged) BuildResult
For image targets.
func NewK8sDeployResult ¶ added in v0.10.5
func NewK8sDeployResult(id model.TargetID, uids []types.UID) BuildResult
For kubernetes deploy targets.
func NewLiveUpdateBuildResult ¶ added in v0.10.0
func NewLiveUpdateBuildResult(id model.TargetID, containerIDs []container.ID) BuildResult
For in-place container updates.
func (BuildResult) HasImage ¶
func (b BuildResult) HasImage() bool
func (BuildResult) IsEmpty ¶
func (b BuildResult) IsEmpty() bool
func (BuildResult) IsInPlaceUpdate ¶ added in v0.8.6
func (b BuildResult) IsInPlaceUpdate() bool
type BuildResultSet ¶ added in v0.5.1
type BuildResultSet map[model.TargetID]BuildResult
func MergeBuildResultsSet ¶ added in v0.10.0
func MergeBuildResultsSet(a, b BuildResultSet) BuildResultSet
func (BuildResultSet) DeployedUIDSet ¶ added in v0.10.5
func (set BuildResultSet) DeployedUIDSet() UIDSet
func (BuildResultSet) LiveUpdatedContainerIDs ¶ added in v0.10.0
func (set BuildResultSet) LiveUpdatedContainerIDs() []container.ID
func (BuildResultSet) OneAndOnlyLiveUpdatedContainerID ¶ added in v0.10.0
func (set BuildResultSet) OneAndOnlyLiveUpdatedContainerID() container.ID
Returns a container ID iff it's the only container ID in the result set. If there are multiple container IDs, we have to give up.
type BuildState ¶
type BuildState struct { // The last successful build. LastResult BuildResult // Files changed since the last result was build. // This must be liberal: it's ok if this has too many files, but not ok if it has too few. FilesChangedSet map[string]bool RunningContainers []ContainerInfo }
The state of the system since the last successful build. This data structure should be considered immutable. All methods that return a new BuildState should first clone the existing build state.
func NewBuildState ¶
func NewBuildState(result BuildResult, files []string) BuildState
func (BuildState) FilesChanged ¶
func (b BuildState) FilesChanged() []string
Return the files changed since the last result in sorted order. The sorting helps ensure that this is deterministic, both for testing and for deterministic builds.
func (BuildState) HasImage ¶
func (b BuildState) HasImage() bool
func (BuildState) IsEmpty ¶
func (b BuildState) IsEmpty() bool
A build state is empty if there are no previous results.
func (BuildState) LastImageAsString ¶ added in v0.4.1
func (b BuildState) LastImageAsString() string
func (BuildState) NeedsImageBuild ¶ added in v0.7.11
func (b BuildState) NeedsImageBuild() bool
Whether the image represented by this state needs to be built. If the image has already been built, and no files have been changed since then, then we can re-use the previous result.
func (BuildState) OneContainerInfo ¶ added in v0.9.7
func (b BuildState) OneContainerInfo() ContainerInfo
NOTE(maia): Interim method to replicate old behavior where every BuildState had a single ContainerInfo
func (BuildState) WithRunningContainers ¶ added in v0.9.7
func (b BuildState) WithRunningContainers(cInfos []ContainerInfo) BuildState
type BuildStateSet ¶ added in v0.5.1
type BuildStateSet map[model.TargetID]BuildState
func (BuildStateSet) Empty ¶ added in v0.5.1
func (set BuildStateSet) Empty() bool
func (BuildStateSet) FilesChanged ¶ added in v0.5.1
func (set BuildStateSet) FilesChanged() []string
type BuildStatus ¶ added in v0.5.1
type BuildStatus struct { // Stores the times of all the pending changes, // so we can prioritize the oldest one first. // This map is mutable. PendingFileChanges map[string]time.Time LastSuccessfulResult BuildResult }
TODO(nick): This will eventually implement TargetStatus
func (BuildStatus) IsEmpty ¶ added in v0.7.11
func (s BuildStatus) IsEmpty() bool
type Container ¶ added in v0.9.6
type ContainerInfo ¶ added in v0.7.11
type ContainerInfo struct { PodID k8s.PodID ContainerID container.ID ContainerName container.Name Namespace k8s.Namespace }
Information describing a single running & ready container
func AllRunningContainers ¶ added in v0.10.0
func AllRunningContainers(mt *ManifestTarget) []ContainerInfo
func RunningContainersForDC ¶ added in v0.9.7
func RunningContainersForDC(state dockercompose.State) []ContainerInfo
func RunningContainersForTargetForOnePod ¶ added in v0.10.0
func RunningContainersForTargetForOnePod(iTarget model.ImageTarget, runtimeState K8sRuntimeState) ([]ContainerInfo, error)
If all containers running the given image are ready, returns info for them. (If this image is running on multiple pods, return an error.)
func (ContainerInfo) Empty ¶ added in v0.9.7
func (c ContainerInfo) Empty() bool
type DirtyBit ¶ added in v0.8.0
type DirtyBit struct {
// contains filtered or unexported fields
}
func NewDirtyBit ¶ added in v0.8.0
func NewDirtyBit() *DirtyBit
func (*DirtyBit) FinishBuild ¶ added in v0.8.0
func (b *DirtyBit) FinishBuild(t DirtyStartToken)
func (*DirtyBit) MarkDirty ¶ added in v0.8.0
func (b *DirtyBit) MarkDirty()
Mark the bit as dirty. If the change happens and this is marked dirty later, that's usually ok. It just means IsDirty might have false positives (i.e., we do spurious builds).
func (*DirtyBit) StartBuildIfDirty ¶ added in v0.8.0
func (b *DirtyBit) StartBuildIfDirty() (DirtyStartToken, bool)
If the bit is currently marked dirty, returns a StartToken to pass to FinishBuild. Otherwise, return false.
type DirtyStartToken ¶ added in v0.8.0
type EngineState ¶
type EngineState struct { TiltBuildInfo model.TiltBuild TiltStartTime time.Time // saved so that we can render in order ManifestDefinitionOrder []model.ManifestName // TODO(nick): This will eventually be a general Target index. ManifestTargets map[model.ManifestName]*ManifestTarget CurrentlyBuilding model.ManifestName WatchFiles bool // How many builds were queued on startup (i.e., how many manifests there were // after initial Tiltfile load) InitialBuildsQueued int // How many builds have been completed (pass or fail) since starting tilt CompletedBuildCount int // For synchronizing BuildController so that it's only // doing one action at a time. In the future, we might // want to allow it to parallelize builds better, but that // would require better tools for triaging output to different streams. BuildControllerActionCount int PermanentError error // The user has indicated they want to exit UserExited bool // The full log stream for tilt. This might deserve gc or file storage at some point. Log model.Log `testdiff:"ignore"` TiltfilePath string ConfigFiles []string TiltIgnoreContents string PendingConfigFileChanges map[string]time.Time // InitManifests is the list of manifest names that we were told to init from the CLI. InitManifests []model.ManifestName TriggerQueue []model.ManifestName LogTimestamps bool IsProfiling bool TiltfileState ManifestState // from GitHub LatestTiltBuild model.TiltBuild // Analytics Info AnalyticsOpt analytics.Opt // changes to this field will propagate into the TiltAnalytics subscriber + we'll record them as user choice AnalyticsNudgeSurfaced bool // this flag is set the first time we show the analytics nudge to the user. Features map[string]bool CloudAddress string Token token.Token TeamName string TiltCloudUsername string TokenKnownUnregistered bool // to distinguish whether an empty TiltCloudUsername means "we haven't checked" or "we checked and the token isn't registered" WaitingForTiltCloudUsernamePostRegistration bool }
func NewState ¶
func NewState() *EngineState
func (*EngineState) BuildStatus ¶ added in v0.5.1
func (e *EngineState) BuildStatus(id model.TargetID) BuildStatus
func (EngineState) DockerComposeConfigPath ¶ added in v0.4.1
func (s EngineState) DockerComposeConfigPath() []string
DockerComposeConfigPath returns the path to the docker-compose yaml file of any docker-compose manifests on this EngineState. NOTE(maia): current assumption is only one d-c.yaml per run, so we take the path from the first d-c manifest we see.
func (EngineState) IsEmpty ¶ added in v0.4.1
func (e EngineState) IsEmpty() bool
func (EngineState) LastTiltfileError ¶ added in v0.2.0
func (e EngineState) LastTiltfileError() error
func (EngineState) Manifest ¶ added in v0.5.0
func (e EngineState) Manifest(mn model.ManifestName) (model.Manifest, bool)
func (*EngineState) ManifestNamesForTargetID ¶ added in v0.7.11
func (e *EngineState) ManifestNamesForTargetID(id model.TargetID) []model.ManifestName
func (EngineState) ManifestState ¶ added in v0.5.0
func (e EngineState) ManifestState(mn model.ManifestName) (*ManifestState, bool)
func (EngineState) ManifestStates ¶
func (e EngineState) ManifestStates() []*ManifestState
Returns ManifestStates in a stable order
func (EngineState) Manifests ¶
func (e EngineState) Manifests() []model.Manifest
Returns Manifests in a stable order
func (EngineState) RelativeTiltfilePath ¶ added in v0.4.1
func (e EngineState) RelativeTiltfilePath() (string, error)
func (EngineState) Targets ¶ added in v0.5.0
func (e EngineState) Targets() []*ManifestTarget
Returns ManifestTargets in a stable order
func (*EngineState) UpsertManifestTarget ¶ added in v0.5.0
func (e *EngineState) UpsertManifestTarget(mt *ManifestTarget)
type ErrorAction ¶ added in v0.7.11
type ErrorAction struct {
Error error
}
func NewErrorAction ¶ added in v0.7.11
func NewErrorAction(err error) ErrorAction
func (ErrorAction) Action ¶ added in v0.7.11
func (ErrorAction) Action()
type K8sEventAction ¶ added in v0.8.10
type K8sEventAction struct { Event *v1.Event ManifestName model.ManifestName }
func NewK8sEventAction ¶ added in v0.8.10
func NewK8sEventAction(event *v1.Event, manifestName model.ManifestName) K8sEventAction
func (K8sEventAction) Action ¶ added in v0.8.10
func (K8sEventAction) Action()
func (K8sEventAction) ToLogAction ¶ added in v0.8.10
func (kEvt K8sEventAction) ToLogAction(mn model.ManifestName) LogAction
type K8sRuntimeState ¶ added in v0.10.5
type K8sRuntimeState struct { // The ancestor that we match pods against to associate them with this manifest. // If we deployed Pod YAML, this will be the Pod UID. // In many cases, this will be a Deployment UID. PodAncestorUID types.UID Pods map[k8s.PodID]*Pod LBs map[k8s.ServiceName]*url.URL DeployedUIDSet UIDSet }
func NewK8sRuntimeState ¶ added in v0.10.5
func NewK8sRuntimeState(pods ...Pod) K8sRuntimeState
func (K8sRuntimeState) ContainsID ¶ added in v0.10.5
func (s K8sRuntimeState) ContainsID(id k8s.PodID) bool
func (K8sRuntimeState) MostRecentPod ¶ added in v0.10.5
func (s K8sRuntimeState) MostRecentPod() Pod
Get the "most recent pod" from the K8sRuntimeState. For most users, we believe there will be only one pod per manifest. So most of this time, this will return the only pod. And in other cases, it will return a reasonable, consistent default.
func (K8sRuntimeState) PodLen ¶ added in v0.10.5
func (s K8sRuntimeState) PodLen() int
func (K8sRuntimeState) PodList ¶ added in v0.10.5
func (s K8sRuntimeState) PodList() []Pod
func (K8sRuntimeState) RuntimeState ¶ added in v0.10.5
func (K8sRuntimeState) RuntimeState()
type LocalRuntimeState ¶ added in v0.10.9
type LocalRuntimeState struct{}
Currently just a placeholder, as a LocalResource has no runtime state, only "build" state. In future, we may use this to store runtime state for long-running processes kicked off via a LocalResource.
func (LocalRuntimeState) RuntimeState ¶ added in v0.10.9
func (LocalRuntimeState) RuntimeState()
type LogAction ¶ added in v0.8.1
type LogAction interface { Action model.LogEvent // Ideally, all logs should be associated with a source. // // In practice, not all logs have an obvious source identifier, // so this might be empty. // // Right now, that source is a ManifestName. But in the future, // this might make more sense as another kind of identifier. // // (As of this writing, we have TargetID as an abstract build-time // source identifier, but no generic run-time source identifier) Source() model.ManifestName }
type LogActionsFlag ¶ added in v0.2.0
type LogActionsFlag bool
type LogEvent ¶ added in v0.8.1
type LogEvent struct {
// contains filtered or unexported fields
}
func NewGlobalLogEvent ¶ added in v0.8.9
func NewLogEvent ¶ added in v0.8.1
func NewLogEvent(mn model.ManifestName, b []byte) LogEvent
func (LogEvent) Source ¶ added in v0.8.9
func (le LogEvent) Source() model.ManifestName
type ManifestState ¶
type ManifestState struct { Name model.ManifestName DeployID model.DeployID // ID we have assigned to the current deploy (helps find expected k8s objects) BuildStatuses map[model.TargetID]*BuildStatus RuntimeState RuntimeState PendingManifestChange time.Time // The current build CurrentBuild model.BuildRecord LastSuccessfulDeployTime time.Time // The last `BuildHistoryLimit` builds. The most recent build is first in the slice. BuildHistory []model.BuildRecord // The container IDs that we've run a LiveUpdate on, if any. Their contents have // diverged from the image they are built on. If these container don't appear on // the pod, we've lost that state and need to rebuild. LiveUpdatedContainerIDs map[container.ID]bool // We detected stale code and are currently doing an image build NeedsRebuildFromCrash bool // If a pod had to be killed because it was crashing, we keep the old log // around for a little while so we can show it in the UX. CrashLog model.Log // The log stream for this resource CombinedLog model.Log `testdiff:"ignore"` // If this manifest was changed, which config files led to the most recent change in manifest definition ConfigFilesThatCausedChange []string }
func (*ManifestState) ActiveBuild ¶ added in v0.4.3
func (ms *ManifestState) ActiveBuild() model.BuildRecord
func (*ManifestState) AddCompletedBuild ¶ added in v0.4.1
func (ms *ManifestState) AddCompletedBuild(bs model.BuildRecord)
func (*ManifestState) BuildStatus ¶ added in v0.5.1
func (ms *ManifestState) BuildStatus(id model.TargetID) BuildStatus
func (*ManifestState) DCRuntimeState ¶ added in v0.10.5
func (ms *ManifestState) DCRuntimeState() dockercompose.State
func (*ManifestState) GetOrCreateK8sRuntimeState ¶ added in v0.10.5
func (ms *ManifestState) GetOrCreateK8sRuntimeState() K8sRuntimeState
func (*ManifestState) HasPendingChanges ¶ added in v0.4.1
func (ms *ManifestState) HasPendingChanges() (bool, time.Time)
Whether changes have been made to this Manifest's synced files or config since the last build.
Returns: bool: whether changes have been made Time: the time of the earliest change
func (*ManifestState) HasPendingChangesBefore ¶ added in v0.4.1
Like HasPendingChanges, but relative to a particular time.
func (*ManifestState) HasPendingFileChanges ¶ added in v0.7.11
func (ms *ManifestState) HasPendingFileChanges() bool
func (*ManifestState) IsDC ¶ added in v0.4.1
func (ms *ManifestState) IsDC() bool
func (*ManifestState) IsK8s ¶ added in v0.10.5
func (ms *ManifestState) IsK8s() bool
func (*ManifestState) IsPendingTime ¶ added in v0.2.0
func (ms *ManifestState) IsPendingTime(t time.Time) bool
Whether a change at the given time should trigger a build. Used to determine if changes to synced files or config files should kick off a new build.
func (*ManifestState) K8sRuntimeState ¶ added in v0.10.5
func (ms *ManifestState) K8sRuntimeState() K8sRuntimeState
func (*ManifestState) LastBuild ¶
func (ms *ManifestState) LastBuild() model.BuildRecord
func (*ManifestState) MostRecentPod ¶ added in v0.2.0
func (ms *ManifestState) MostRecentPod() Pod
func (*ManifestState) MutableBuildStatus ¶ added in v0.5.1
func (ms *ManifestState) MutableBuildStatus(id model.TargetID) *BuildStatus
func (*ManifestState) NextBuildReason ¶ added in v0.2.0
func (ms *ManifestState) NextBuildReason() model.BuildReason
func (*ManifestState) StartedFirstBuild ¶ added in v0.2.0
func (ms *ManifestState) StartedFirstBuild() bool
func (*ManifestState) TargetID ¶ added in v0.4.3
func (ms *ManifestState) TargetID() model.TargetID
type ManifestTarget ¶ added in v0.5.0
type ManifestTarget struct { Manifest model.Manifest State *ManifestState }
func NewManifestTarget ¶ added in v0.5.0
func NewManifestTarget(m model.Manifest) *ManifestTarget
func (ManifestTarget) Spec ¶ added in v0.5.0
func (t ManifestTarget) Spec() model.TargetSpec
func (ManifestTarget) Status ¶ added in v0.5.0
func (t ManifestTarget) Status() model.TargetStatus
type Pod ¶
type Pod struct { PodID k8s.PodID Namespace k8s.Namespace StartedAt time.Time Status string Phase v1.PodPhase // Error messages from the pod state if it's in an error state. StatusMessages []string // Set when we get ready to replace a pod. We may do the update in-place. UpdateStartTime time.Time // If a pod is being deleted, Kubernetes marks it as Running // until it actually gets removed. Deleting bool HasSynclet bool // The log for the currently active pod, if any CurrentLog model.Log `testdiff:"ignore"` Containers []Container // We want to show the user # of restarts since some baseline time // i.e. Total Restarts - BaselineRestarts BaselineRestarts int }
func (Pod) AllContainerPorts ¶ added in v0.10.0
func (Pod) AllContainerRestarts ¶ added in v0.10.0
func (Pod) AllContainersReady ¶ added in v0.10.0
func (Pod) VisibleContainerRestarts ¶ added in v0.10.8
type PodResetRestartsAction ¶ added in v0.10.8
type PodResetRestartsAction struct { PodID k8s.PodID ManifestName model.ManifestName VisibleRestarts int }
The user can indicate "yes, I know the pod restarted N times, stop showing me"
func NewPodResetRestartsAction ¶ added in v0.10.8
func NewPodResetRestartsAction(podID k8s.PodID, mn model.ManifestName, visibleRestarts int) PodResetRestartsAction
func (PodResetRestartsAction) Action ¶ added in v0.10.8
func (PodResetRestartsAction) Action()
type RStore ¶ added in v0.2.0
type RStore interface { Dispatch(action Action) RLockState() EngineState RUnlockState() }
Read-only store
type Reducer ¶ added in v0.1.0
type Reducer func(ctx context.Context, engineState *EngineState, action Action)
type RuntimeState ¶ added in v0.10.5
type RuntimeState interface {
RuntimeState()
}
type SetUpper ¶ added in v0.8.2
Some subscribers need to do SetUp or TearDown. Both hold the subscriber lock, so should return quickly.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
A central state store, modeled after the Reactive programming UX pattern. Terminology is borrowed liberally from Redux. These docs in particular are helpful: https://redux.js.org/introduction/threeprinciples https://redux.js.org/basics
func NewStore ¶
func NewStore(reducer Reducer, logActions LogActionsFlag) *Store
func NewStoreForTesting ¶ added in v0.1.0
Returns a Store for testing that saves observed actions and makes them available via the return value `getActions`
func (*Store) AddSubscriber ¶
func (s *Store) AddSubscriber(ctx context.Context, sub Subscriber)
func (*Store) LockMutableStateForTesting ¶ added in v0.1.0
func (s *Store) LockMutableStateForTesting() *EngineState
func (*Store) NotifySubscribers ¶
Sends messages to all the subscribers asynchronously.
func (*Store) RLockState ¶
func (s *Store) RLockState() EngineState
TODO(nick): Clone the state to ensure it's not mutated. For now, we use RW locks to simulate the same behavior, but the onus is on the caller to RUnlockState.
func (*Store) RUnlockState ¶
func (s *Store) RUnlockState()
func (*Store) RemoveSubscriber ¶ added in v0.4.1
func (s *Store) RemoveSubscriber(ctx context.Context, sub Subscriber) error
func (*Store) SetUpSubscribersForTesting ¶ added in v0.8.2
func (*Store) UnlockMutableState ¶
func (s *Store) UnlockMutableState()
type Subscriber ¶
A subscriber is notified whenever the state changes.
Subscribers do not need to be thread-safe. The Store will only call OnChange for a given subscriber when the last call completes.
Subscribers are only allowed to read state. If they want to modify state, they should call store.Dispatch()
type SubscriberLifecycle ¶ added in v0.7.11
type SubscriberLifecycle interface { SetUpper TearDowner }
Convenience interface for subscriber fulfilling both SetUpper and TearDowner
type TearDowner ¶ added in v0.8.2
type TestingStore ¶ added in v0.2.0
type TestingStore struct { Actions []Action // contains filtered or unexported fields }
func NewTestingStore ¶ added in v0.2.0
func NewTestingStore() *TestingStore
func (*TestingStore) Dispatch ¶ added in v0.2.0
func (s *TestingStore) Dispatch(action Action)
func (*TestingStore) RLockState ¶ added in v0.2.0
func (s *TestingStore) RLockState() EngineState
func (*TestingStore) RUnlockState ¶ added in v0.2.0
func (s *TestingStore) RUnlockState()
func (*TestingStore) SetState ¶ added in v0.2.0
func (s *TestingStore) SetState(state EngineState)
type TiltCloudUserLookedUpAction ¶ added in v0.10.5
type TiltCloudUserLookedUpAction struct { Found bool Username string IsPostRegistrationLookup bool }
func (TiltCloudUserLookedUpAction) Action ¶ added in v0.10.5
func (TiltCloudUserLookedUpAction) Action()
type UserStartedTiltCloudRegistrationAction ¶ added in v0.10.7
type UserStartedTiltCloudRegistrationAction struct{}
func (UserStartedTiltCloudRegistrationAction) Action ¶ added in v0.10.7
func (UserStartedTiltCloudRegistrationAction) Action()
type YAMLManifestState ¶ added in v0.1.0
type YAMLManifestState struct { HasBeenDeployed bool CurrentApplyStartTime time.Time LastError error LastApplyFinishTime time.Time LastSuccessfulApplyTime time.Time LastApplyStartTime time.Time }
func NewYAMLManifestState ¶ added in v0.1.0
func NewYAMLManifestState() *YAMLManifestState
func (*YAMLManifestState) ActiveBuild ¶ added in v0.4.3
func (s *YAMLManifestState) ActiveBuild() model.BuildRecord
func (*YAMLManifestState) LastBuild ¶ added in v0.4.3
func (s *YAMLManifestState) LastBuild() model.BuildRecord
func (*YAMLManifestState) TargetID ¶ added in v0.4.3
func (s *YAMLManifestState) TargetID() model.TargetID