github.com/opentofu/opentofu@v1.7.1/internal/legacy/helper/schema/resource_data_get_source.go (about)

     1  // Copyright (c) The OpenTofu Authors
     2  // SPDX-License-Identifier: MPL-2.0
     3  // Copyright (c) 2023 HashiCorp, Inc.
     4  // SPDX-License-Identifier: MPL-2.0
     5  
     6  package schema
     7  
     8  //go:generate go run golang.org/x/tools/cmd/stringer -type=getSource resource_data_get_source.go
     9  
    10  // getSource represents the level we want to get for a value (internally).
    11  // Any source less than or equal to the level will be loaded (whichever
    12  // has a value first).
    13  type getSource byte
    14  
    15  const (
    16  	getSourceState getSource = 1 << iota
    17  	getSourceConfig
    18  	getSourceDiff
    19  	getSourceSet
    20  	getSourceExact               // Only get from the _exact_ level
    21  	getSourceLevelMask getSource = getSourceState | getSourceConfig | getSourceDiff | getSourceSet
    22  )