opentofu/internal/plans/action.go
Martin Atkins 034e944070 Move plans/ to internal/plans/
This is part of a general effort to move all of Terraform's non-library
package surface under internal in order to reinforce that these are for
internal use within Terraform only.

If you were previously importing packages under this prefix into an
external codebase, you could pin to an earlier release tag as an interim
solution until you've make a plan to achieve the same functionality some
other way.
2021-05-17 14:09:07 -07:00

23 lines
597 B
Go

package plans
type Action rune
const (
NoOp Action = 0
Create Action = '+'
Read Action = '←'
Update Action = '~'
DeleteThenCreate Action = '∓'
CreateThenDelete Action = '±'
Delete Action = '-'
)
//go:generate go run golang.org/x/tools/cmd/stringer -type Action
// IsReplace returns true if the action is one of the two actions that
// represents replacing an existing object with a new object:
// DeleteThenCreate or CreateThenDelete.
func (a Action) IsReplace() bool {
return a == DeleteThenCreate || a == CreateThenDelete
}