github.com/graywolf-at-work-2/terraform-vendor@v1.4.5/internal/states/statemgr/lock.go (about)

     1  package statemgr
     2  
     3  import (
     4  	"github.com/hashicorp/terraform/internal/states"
     5  	"github.com/hashicorp/terraform/internal/terraform"
     6  )
     7  
     8  // LockDisabled implements State and Locker but disables state locking.
     9  // If State doesn't support locking, this is a no-op. This is useful for
    10  // easily disabling locking of an existing state or for tests.
    11  type LockDisabled struct {
    12  	// We can't embed State directly since Go dislikes that a field is
    13  	// State and State interface has a method State
    14  	Inner Full
    15  }
    16  
    17  func (s *LockDisabled) State() *states.State {
    18  	return s.Inner.State()
    19  }
    20  
    21  func (s *LockDisabled) GetRootOutputValues() (map[string]*states.OutputValue, error) {
    22  	return s.Inner.GetRootOutputValues()
    23  }
    24  
    25  func (s *LockDisabled) WriteState(v *states.State) error {
    26  	return s.Inner.WriteState(v)
    27  }
    28  
    29  func (s *LockDisabled) RefreshState() error {
    30  	return s.Inner.RefreshState()
    31  }
    32  
    33  func (s *LockDisabled) PersistState(schemas *terraform.Schemas) error {
    34  	return s.Inner.PersistState(schemas)
    35  }
    36  
    37  func (s *LockDisabled) Lock(info *LockInfo) (string, error) {
    38  	return "", nil
    39  }
    40  
    41  func (s *LockDisabled) Unlock(id string) error {
    42  	return nil
    43  }