github.com/terramate-io/tf@v0.0.0-20230830114523-fce866b4dfcd/registry/response/module_versions.go (about)

     1  // Copyright (c) HashiCorp, Inc.
     2  // SPDX-License-Identifier: MPL-2.0
     3  
     4  package response
     5  
     6  // ModuleVersions is the response format that contains all metadata about module
     7  // versions needed for terraform CLI to resolve version constraints. See RFC
     8  // TF-042 for details on this format.
     9  type ModuleVersions struct {
    10  	Modules []*ModuleProviderVersions `json:"modules"`
    11  }
    12  
    13  // ModuleProviderVersions is the response format for a single module instance,
    14  // containing metadata about all versions and their dependencies.
    15  type ModuleProviderVersions struct {
    16  	Source   string           `json:"source"`
    17  	Versions []*ModuleVersion `json:"versions"`
    18  }
    19  
    20  // ModuleVersion is the output metadata for a given version needed by CLI to
    21  // resolve candidate versions to satisfy requirements.
    22  type ModuleVersion struct {
    23  	Version    string              `json:"version"`
    24  	Root       VersionSubmodule    `json:"root"`
    25  	Submodules []*VersionSubmodule `json:"submodules"`
    26  }
    27  
    28  // VersionSubmodule is the output metadata for a submodule within a given
    29  // version needed by CLI to resolve candidate versions to satisfy requirements.
    30  // When representing the Root in JSON the path is omitted.
    31  type VersionSubmodule struct {
    32  	Path         string               `json:"path,omitempty"`
    33  	Providers    []*ModuleProviderDep `json:"providers"`
    34  	Dependencies []*ModuleDep         `json:"dependencies"`
    35  }