github.com/hs0210/hashicorp-terraform@v0.11.12-beta1/registry/response/module.go (about)

     1  package response
     2  
     3  import (
     4  	"time"
     5  )
     6  
     7  // Module is the response structure with the data for a single module version.
     8  type Module struct {
     9  	ID string `json:"id"`
    10  
    11  	//---------------------------------------------------------------
    12  	// Metadata about the overall module.
    13  
    14  	Owner       string    `json:"owner"`
    15  	Namespace   string    `json:"namespace"`
    16  	Name        string    `json:"name"`
    17  	Version     string    `json:"version"`
    18  	Provider    string    `json:"provider"`
    19  	Description string    `json:"description"`
    20  	Source      string    `json:"source"`
    21  	PublishedAt time.Time `json:"published_at"`
    22  	Downloads   int       `json:"downloads"`
    23  	Verified    bool      `json:"verified"`
    24  }
    25  
    26  // ModuleDetail represents a module in full detail.
    27  type ModuleDetail struct {
    28  	Module
    29  
    30  	//---------------------------------------------------------------
    31  	// Metadata about the overall module. This is only available when
    32  	// requesting the specific module (not in list responses).
    33  
    34  	// Root is the root module.
    35  	Root *ModuleSubmodule `json:"root"`
    36  
    37  	// Submodules are the other submodules that are available within
    38  	// this module.
    39  	Submodules []*ModuleSubmodule `json:"submodules"`
    40  
    41  	//---------------------------------------------------------------
    42  	// The fields below are only set when requesting this specific
    43  	// module. They are available to easily know all available versions
    44  	// and providers without multiple API calls.
    45  
    46  	Providers []string `json:"providers"` // All available providers
    47  	Versions  []string `json:"versions"`  // All versions
    48  }
    49  
    50  // ModuleSubmodule is the metadata about a specific submodule within
    51  // a module. This includes the root module as a special case.
    52  type ModuleSubmodule struct {
    53  	Path   string `json:"path"`
    54  	Readme string `json:"readme"`
    55  	Empty  bool   `json:"empty"`
    56  
    57  	Inputs       []*ModuleInput    `json:"inputs"`
    58  	Outputs      []*ModuleOutput   `json:"outputs"`
    59  	Dependencies []*ModuleDep      `json:"dependencies"`
    60  	Resources    []*ModuleResource `json:"resources"`
    61  }
    62  
    63  // ModuleInput is an input for a module.
    64  type ModuleInput struct {
    65  	Name        string `json:"name"`
    66  	Description string `json:"description"`
    67  	Default     string `json:"default"`
    68  }
    69  
    70  // ModuleOutput is an output for a module.
    71  type ModuleOutput struct {
    72  	Name        string `json:"name"`
    73  	Description string `json:"description"`
    74  }
    75  
    76  // ModuleDep is an output for a module.
    77  type ModuleDep struct {
    78  	Name    string `json:"name"`
    79  	Source  string `json:"source"`
    80  	Version string `json:"version"`
    81  }
    82  
    83  // ModuleProviderDep is the output for a provider dependency
    84  type ModuleProviderDep struct {
    85  	Name    string `json:"name"`
    86  	Version string `json:"version"`
    87  }
    88  
    89  // ModuleResource is an output for a module.
    90  type ModuleResource struct {
    91  	Name string `json:"name"`
    92  	Type string `json:"type"`
    93  }