Documentation ¶
Index ¶
- Constants
- Variables
- func FilePathEndsWithExtensionFrom(path string, validExtensions []string) bool
- func FileSizeCheck(fullpath string) error
- func GetDirectories(basepath string) (map[string][]string, error)
- func InvalidDirectoriesCheck(directories map[string][]string) error
- func IsValidCdktfDirectory(directory string) bool
- func IsValidLegacyDirectory(directory string) bool
- func IsValidRegistryDirectory(directory string) bool
- func LegacyFileExtensionCheck(path string) error
- func MixedDirectoriesCheck(directories map[string][]string) error
- func NumberOfFilesCheck(directories map[string][]string) error
- func RegistryFileExtensionCheck(path string) error
- func TrimFileExtension(path string) string
- type Check
- type CheckOptions
- type ContentsCheck
- type ContentsOptions
- type FileCheck
- type FileMismatchCheck
- type FileMismatchOptions
- type FileOptions
- type FrontMatterCheck
- type FrontMatterData
- type FrontMatterOptions
- type LegacyDataSourceFileCheck
- type LegacyDataSourceFileOptions
- type LegacyFunctionFileCheck
- type LegacyFunctionFileOptions
- type LegacyGuideFileCheck
- type LegacyGuideFileOptions
- type LegacyIndexFileCheck
- type LegacyIndexFileOptions
- type LegacyResourceFileCheck
- type LegacyResourceFileOptions
- type RegistryDataSourceFileCheck
- type RegistryDataSourceFileOptions
- type RegistryFunctionFileCheck
- type RegistryFunctionFileOptions
- type RegistryGuideFileCheck
- type RegistryGuideFileOptions
- type RegistryIndexFileCheck
- type RegistryIndexFileOptions
- type RegistryResourceFileCheck
- type RegistryResourceFileOptions
Constants ¶
View Source
const ( ResourceTypeDataSource = "data source" ResourceTypeFunction = "function" ResourceTypeResource = "resource" // Terraform Registry Storage Limits // https://www.terraform.io/docs/registry/providers/docs.html#storage-limits RegistryMaximumNumberOfFiles = 2000 RegistryMaximumSizeOfFile = 500000 // 500KB )
View Source
const ( CdktfIndexDirectory = `cdktf` DocumentationGlobPattern = `{docs/index.md,docs/{,cdktf/}{data-sources,guides,resources},website/docs}/**/*` LegacyIndexDirectory = `website/docs` LegacyDataSourcesDirectory = `d` LegacyFunctionsDirectory = `functions` LegacyGuidesDirectory = `guides` LegacyResourcesDirectory = `r` RegistryIndexDirectory = `docs` RegistryDataSourcesDirectory = `data-sources` RegistryFunctionsDirectory = `functions` RegistryGuidesDirectory = `guides` RegistryResourcesDirectory = `resources` )
View Source
const ( FileExtensionHtmlMarkdown = `.html.markdown` FileExtensionHtmlMd = `.html.md` FileExtensionMarkdown = `.markdown` FileExtensionMd = `.md` )
Variables ¶
View Source
var ValidCdktfLanguages = []string{
"csharp",
"go",
"java",
"python",
"typescript",
}
View Source
var ValidLegacyDirectories = []string{ LegacyIndexDirectory, LegacyIndexDirectory + "/" + LegacyDataSourcesDirectory, LegacyIndexDirectory + "/" + LegacyFunctionsDirectory, LegacyIndexDirectory + "/" + LegacyGuidesDirectory, LegacyIndexDirectory + "/" + LegacyResourcesDirectory, }
View Source
var ValidLegacyFileExtensions = []string{ FileExtensionHtmlMarkdown, FileExtensionHtmlMd, FileExtensionMarkdown, FileExtensionMd, }
View Source
var ValidLegacySubdirectories = []string{ LegacyDataSourcesDirectory, LegacyFunctionsDirectory, LegacyGuidesDirectory, LegacyResourcesDirectory, }
View Source
var ValidRegistryDirectories = []string{ RegistryIndexDirectory, RegistryIndexDirectory + "/" + RegistryDataSourcesDirectory, RegistryIndexDirectory + "/" + RegistryFunctionsDirectory, RegistryIndexDirectory + "/" + RegistryGuidesDirectory, RegistryIndexDirectory + "/" + RegistryResourcesDirectory, }
View Source
var ValidRegistryFileExtensions = []string{ FileExtensionMd, }
View Source
var ValidRegistrySubdirectories = []string{ RegistryDataSourcesDirectory, RegistryFunctionsDirectory, RegistryGuidesDirectory, RegistryResourcesDirectory, }
Functions ¶
func FileSizeCheck ¶
FileSizeCheck verifies that documentation file is below the Terraform Registry storage limit.
func InvalidDirectoriesCheck ¶
func IsValidCdktfDirectory ¶ added in v0.10.0
func IsValidLegacyDirectory ¶
func MixedDirectoriesCheck ¶
func NumberOfFilesCheck ¶
NumberOfFilesCheck verifies that documentation is below the Terraform Registry storage limit. This check presumes that all provided directories are valid, e.g. that directory checking for invalid or mixed directory structures was previously completed.
func TrimFileExtension ¶
TrimFileExtension removes file extensions including those with multiple periods.
Types ¶
type Check ¶
type Check struct {
Options *CheckOptions
}
func NewCheck ¶
func NewCheck(opts *CheckOptions) *Check
type CheckOptions ¶
type CheckOptions struct { DataSourceFileMismatch *FileMismatchOptions FunctionFileMismatch *FileMismatchOptions LegacyDataSourceFile *LegacyDataSourceFileOptions LegacyFunctionFile *LegacyFunctionFileOptions LegacyGuideFile *LegacyGuideFileOptions LegacyIndexFile *LegacyIndexFileOptions LegacyResourceFile *LegacyResourceFileOptions ProviderName string ProviderSource string RegistryDataSourceFile *RegistryDataSourceFileOptions RegistryFunctionFile *RegistryFunctionFileOptions RegistryGuideFile *RegistryGuideFileOptions RegistryIndexFile *RegistryIndexFileOptions RegistryResourceFile *RegistryResourceFileOptions ResourceFileMismatch *FileMismatchOptions IgnoreCdktfMissingFiles bool }
type ContentsCheck ¶ added in v0.8.0
type ContentsCheck struct {
Options *ContentsOptions
}
func NewContentsCheck ¶ added in v0.8.0
func NewContentsCheck(opts *ContentsOptions) *ContentsCheck
type ContentsOptions ¶ added in v0.8.0
type ContentsOptions struct { *FileOptions Enable bool ProviderName string RequireSchemaOrdering bool }
ContentsOptions represents configuration options for Contents.
type FileMismatchCheck ¶ added in v0.6.0
type FileMismatchCheck struct {
Options *FileMismatchOptions
}
func NewFileMismatchCheck ¶ added in v0.6.0
func NewFileMismatchCheck(opts *FileMismatchOptions) *FileMismatchCheck
func (*FileMismatchCheck) IgnoreFileMismatch ¶ added in v0.6.0
func (check *FileMismatchCheck) IgnoreFileMismatch(file string) bool
func (*FileMismatchCheck) IgnoreFileMissing ¶ added in v0.6.0
func (check *FileMismatchCheck) IgnoreFileMissing(resourceName string) bool
func (*FileMismatchCheck) Run ¶ added in v0.6.0
func (check *FileMismatchCheck) Run(files []string) error
type FileMismatchOptions ¶ added in v0.6.0
type FileOptions ¶
type FileOptions struct {
BasePath string
}
func (*FileOptions) FullPath ¶
func (opts *FileOptions) FullPath(path string) string
type FrontMatterCheck ¶
type FrontMatterCheck struct {
Options *FrontMatterOptions
}
func NewFrontMatterCheck ¶
func NewFrontMatterCheck(opts *FrontMatterOptions) *FrontMatterCheck
func (*FrontMatterCheck) Run ¶
func (check *FrontMatterCheck) Run(src []byte) error
type FrontMatterData ¶
type FrontMatterData struct { Description *string `yaml:"description,omitempty"` Layout *string `yaml:"layout,omitempty"` PageTitle *string `yaml:"page_title,omitempty"` SidebarCurrent *string `yaml:"sidebar_current,omitempty"` Subcategory *string `yaml:"subcategory,omitempty"` }
FrontMatterData represents the YAML frontmatter of Terraform Provider documentation.
type FrontMatterOptions ¶
type FrontMatterOptions struct { AllowedSubcategories []string NoDescription bool NoLayout bool NoPageTitle bool NoSidebarCurrent bool NoSubcategory bool RequireDescription bool RequireLayout bool RequirePageTitle bool RequireSubcategory bool }
FrontMatterOptions represents configuration options for FrontMatter.
type LegacyDataSourceFileCheck ¶
type LegacyDataSourceFileCheck struct { FileCheck Options *LegacyDataSourceFileOptions }
func NewLegacyDataSourceFileCheck ¶
func NewLegacyDataSourceFileCheck(opts *LegacyDataSourceFileOptions) *LegacyDataSourceFileCheck
func (*LegacyDataSourceFileCheck) Run ¶
func (check *LegacyDataSourceFileCheck) Run(path string) error
func (*LegacyDataSourceFileCheck) RunAll ¶
func (check *LegacyDataSourceFileCheck) RunAll(files []string) error
type LegacyDataSourceFileOptions ¶
type LegacyDataSourceFileOptions struct { *FileOptions FrontMatter *FrontMatterOptions }
type LegacyFunctionFileCheck ¶ added in v0.12.0
type LegacyFunctionFileCheck struct { FileCheck Options *LegacyFunctionFileOptions }
func NewLegacyFunctionFileCheck ¶ added in v0.12.0
func NewLegacyFunctionFileCheck(opts *LegacyFunctionFileOptions) *LegacyFunctionFileCheck
func (*LegacyFunctionFileCheck) Run ¶ added in v0.12.0
func (check *LegacyFunctionFileCheck) Run(path string) error
func (*LegacyFunctionFileCheck) RunAll ¶ added in v0.12.0
func (check *LegacyFunctionFileCheck) RunAll(files []string) error
type LegacyFunctionFileOptions ¶ added in v0.12.0
type LegacyFunctionFileOptions struct { *FileOptions FrontMatter *FrontMatterOptions }
type LegacyGuideFileCheck ¶
type LegacyGuideFileCheck struct { FileCheck Options *LegacyGuideFileOptions }
func NewLegacyGuideFileCheck ¶
func NewLegacyGuideFileCheck(opts *LegacyGuideFileOptions) *LegacyGuideFileCheck
func (*LegacyGuideFileCheck) Run ¶
func (check *LegacyGuideFileCheck) Run(path string) error
func (*LegacyGuideFileCheck) RunAll ¶
func (check *LegacyGuideFileCheck) RunAll(files []string) error
type LegacyGuideFileOptions ¶
type LegacyGuideFileOptions struct { *FileOptions FrontMatter *FrontMatterOptions }
type LegacyIndexFileCheck ¶
type LegacyIndexFileCheck struct { FileCheck Options *LegacyIndexFileOptions }
func NewLegacyIndexFileCheck ¶
func NewLegacyIndexFileCheck(opts *LegacyIndexFileOptions) *LegacyIndexFileCheck
func (*LegacyIndexFileCheck) Run ¶
func (check *LegacyIndexFileCheck) Run(path string) error
func (*LegacyIndexFileCheck) RunAll ¶
func (check *LegacyIndexFileCheck) RunAll(files []string) error
type LegacyIndexFileOptions ¶
type LegacyIndexFileOptions struct { *FileOptions FrontMatter *FrontMatterOptions }
type LegacyResourceFileCheck ¶
type LegacyResourceFileCheck struct { FileCheck Options *LegacyResourceFileOptions }
func NewLegacyResourceFileCheck ¶
func NewLegacyResourceFileCheck(opts *LegacyResourceFileOptions) *LegacyResourceFileCheck
type LegacyResourceFileOptions ¶
type LegacyResourceFileOptions struct { *FileOptions Contents *ContentsOptions FrontMatter *FrontMatterOptions ProviderName string }
type RegistryDataSourceFileCheck ¶
type RegistryDataSourceFileCheck struct { FileCheck Options *RegistryDataSourceFileOptions }
func NewRegistryDataSourceFileCheck ¶
func NewRegistryDataSourceFileCheck(opts *RegistryDataSourceFileOptions) *RegistryDataSourceFileCheck
func (*RegistryDataSourceFileCheck) Run ¶
func (check *RegistryDataSourceFileCheck) Run(path string) error
func (*RegistryDataSourceFileCheck) RunAll ¶
func (check *RegistryDataSourceFileCheck) RunAll(files []string) error
type RegistryDataSourceFileOptions ¶
type RegistryDataSourceFileOptions struct { *FileOptions FrontMatter *FrontMatterOptions }
type RegistryFunctionFileCheck ¶ added in v0.12.0
type RegistryFunctionFileCheck struct { FileCheck Options *RegistryFunctionFileOptions }
func NewRegistryFunctionFileCheck ¶ added in v0.12.0
func NewRegistryFunctionFileCheck(opts *RegistryFunctionFileOptions) *RegistryFunctionFileCheck
func (*RegistryFunctionFileCheck) Run ¶ added in v0.12.0
func (check *RegistryFunctionFileCheck) Run(path string) error
func (*RegistryFunctionFileCheck) RunAll ¶ added in v0.12.0
func (check *RegistryFunctionFileCheck) RunAll(files []string) error
type RegistryFunctionFileOptions ¶ added in v0.12.0
type RegistryFunctionFileOptions struct { *FileOptions FrontMatter *FrontMatterOptions }
type RegistryGuideFileCheck ¶
type RegistryGuideFileCheck struct { FileCheck Options *RegistryGuideFileOptions }
func NewRegistryGuideFileCheck ¶
func NewRegistryGuideFileCheck(opts *RegistryGuideFileOptions) *RegistryGuideFileCheck
func (*RegistryGuideFileCheck) Run ¶
func (check *RegistryGuideFileCheck) Run(path string) error
func (*RegistryGuideFileCheck) RunAll ¶
func (check *RegistryGuideFileCheck) RunAll(files []string) error
type RegistryGuideFileOptions ¶
type RegistryGuideFileOptions struct { *FileOptions FrontMatter *FrontMatterOptions }
type RegistryIndexFileCheck ¶
type RegistryIndexFileCheck struct { FileCheck Options *RegistryIndexFileOptions }
func NewRegistryIndexFileCheck ¶
func NewRegistryIndexFileCheck(opts *RegistryIndexFileOptions) *RegistryIndexFileCheck
func (*RegistryIndexFileCheck) Run ¶
func (check *RegistryIndexFileCheck) Run(path string) error
func (*RegistryIndexFileCheck) RunAll ¶
func (check *RegistryIndexFileCheck) RunAll(files []string) error
type RegistryIndexFileOptions ¶
type RegistryIndexFileOptions struct { *FileOptions FrontMatter *FrontMatterOptions }
type RegistryResourceFileCheck ¶
type RegistryResourceFileCheck struct { FileCheck Options *RegistryResourceFileOptions }
func NewRegistryResourceFileCheck ¶
func NewRegistryResourceFileCheck(opts *RegistryResourceFileOptions) *RegistryResourceFileCheck
type RegistryResourceFileOptions ¶
type RegistryResourceFileOptions struct { *FileOptions Contents *ContentsOptions FrontMatter *FrontMatterOptions ProviderName string }
Source Files ¶
- check.go
- contents.go
- directory.go
- file.go
- file_extension.go
- file_mismatch.go
- frontmatter.go
- legacy_data_source_file.go
- legacy_function_file.go
- legacy_guide_file.go
- legacy_index_file.go
- legacy_resource_file.go
- registry_data_source_file.go
- registry_function_file.go
- registry_guide_file.go
- registry_index_file.go
- registry_resource_file.go
Click to show internal directories.
Click to hide internal directories.