github.com/verrazzano/verrazzano@v1.7.0/platform-operator/internal/monitor/fake/fake_monitor.go (about)

     1  // Copyright (c) 2022, 2023, Oracle and/or its affiliates.
     2  // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
     3  
     4  package fake
     5  
     6  import "github.com/verrazzano/verrazzano/platform-operator/internal/monitor"
     7  
     8  // BackgroundProcessMonitorType - a fake monitor object.
     9  type BackgroundProcessMonitorType struct {
    10  	Result    bool
    11  	Err       error
    12  	Running   bool
    13  	Completed bool
    14  }
    15  
    16  func (f *BackgroundProcessMonitorType) CheckResult() (bool, error)           { return f.Result, f.Err }
    17  func (f *BackgroundProcessMonitorType) Reset()                               {}
    18  func (f *BackgroundProcessMonitorType) IsRunning() bool                      { return f.Running }
    19  func (f *BackgroundProcessMonitorType) IsCompleted() bool                    { return f.Completed }
    20  func (f *BackgroundProcessMonitorType) SetCompleted()                        { f.Completed = true; f.Running = false }
    21  func (f *BackgroundProcessMonitorType) Run(operation monitor.BackgroundFunc) {}
    22  
    23  // Check that &BackgroundProcessMonitorType implements BackgroundProcessMonitor
    24  var _ monitor.BackgroundProcessMonitor = &BackgroundProcessMonitorType{}