Documentation
¶
Index ¶
- Constants
- func DescriptionCtxOf[T BothDescriptionCtxProvider](ctx context.Context, d T) string
- func DescriptionOf[T BothDescriptionProvider](d T) string
- func MapOrNil[T any, U any](input T, f func(T) U) *U
- func MapOrZero[T any, U any](input T, f func(T) U) U
- func MapSlice[T any, U any](input []T, f func(T) U) []U
- func MapSliceSome[T any, U any](input []T, f func(T) *U) []U
- func MaybeDescriptionCtxOf(ctx context.Context, d any) *string
- func MaybeDescriptionOf(d any) *string
- func PointerTo[T any](ptr *T) T
- func Sentencefy(s string) string
- type ActionMetadata
- type ActionMetadatas
- type ActionRender
- type ActionRenderOption
- type ActionSchema
- type ActionWithRenderOption
- type BothDescriptionCtxProvider
- type BothDescriptionProvider
- type Categorizer
- type Category
- type DataSourceMetadata
- type DataSourceMetadatas
- type DataSourceRender
- type DataSourceRenderOption
- type DataSourceSchema
- type DataSourceWithRenderOption
- type DataType
- type DescriptionCtxProvider
- type DescriptionProvider
- type EphemeralMetadata
- type EphemeralMetadatas
- type EphemeralRender
- type EphemeralRenderOption
- type EphemeralResourceWithRenderOption
- type EphemeralSchema
- type Example
- type Field
- func (r Field) Computed() bool
- func (r Field) CustomTypeDescription() string
- func (r Field) DataType() DataType
- func (r Field) Default() string
- func (r Field) Deprecation() string
- func (r Field) Description() string
- func (r Field) Name() string
- func (field Field) NestedLink() string
- func (r Field) Optional() bool
- func (r Field) Parents() []string
- func (r Field) PlanModifiers() []string
- func (r Field) Required() bool
- func (r Field) Sensitive() bool
- func (field Field) Traits() string
- func (r Field) Validators() []string
- func (r Field) WriteOnly() bool
- type Fields
- type FunctionField
- func (r FunctionField) AllowNull() bool
- func (r FunctionField) AllowUnknown() bool
- func (r FunctionField) CustomTypeDescription() string
- func (r FunctionField) DataType() DataType
- func (r FunctionField) Description() string
- func (r FunctionField) Name() string
- func (field FunctionField) NestedLink() string
- func (r FunctionField) Parents() []string
- func (field FunctionField) Traits() string
- func (r FunctionField) Validators() []string
- type FunctionFields
- type FunctionMetadata
- type FunctionMetadatas
- type FunctionObject
- type FunctionObjects
- type FunctionRender
- type FunctionRenderOption
- type FunctionSchema
- type FunctionWithRenderOption
- type ImportId
- type ListMetadata
- type ListMetadatas
- type ListRender
- type ListRenderOption
- type ListResourceWithRenderOption
- type ListSchema
- type MarkdownDescriptionCtxProvider
- type MarkdownDescriptionProvider
- type Metadata
- func (metadata Metadata) NewActionRender(actionType string, opt *ActionRenderOption) (*ActionRender, error)
- func (metadata Metadata) NewDataSourceRender(dataSourceType string, opt *DataSourceRenderOption) (*DataSourceRender, error)
- func (metadata Metadata) NewEphemeralRender(ephemeralType string, opt *EphemeralRenderOption) (*EphemeralRender, error)
- func (metadata Metadata) NewFunctionRender(functionName string, opt *FunctionRenderOption) (*FunctionRender, error)
- func (metadata Metadata) NewListRender(listType string, opt *ListRenderOption) (*ListRender, error)
- func (metadata Metadata) NewProviderRender(opt *ProviderRenderOption) (*ProviderRender, error)
- func (metadata Metadata) NewResourceRender(resourceType string, opt *ResourceRenderOption) (*ResourceRender, error)
- type NestedField
- type NestedFields
- type Object
- type ObjectField
- type Objects
- type ProviderMetadata
- type ProviderRender
- type ProviderRenderOption
- type ProviderSchema
- type ProviderWithRenderOption
- type ResourceIdentityField
- type ResourceIdentityFields
- type ResourceIdentitySchema
- type ResourceMetadata
- type ResourceMetadatas
- type ResourceRender
- type ResourceRenderOption
- type ResourceSchema
- type ResourceWithRenderOption
Constants ¶
View Source
const ( CategoryProvider = "Provider" CategoryResource = "Resource" CategoryDataSource = "Data Source" CategoryEphemeral = "Ephemeral Resource" CategoryAction = "Action" CategoryList = "List Resource" CategoryFunction = "Function" )
Variables ¶
This section is empty.
Functions ¶
func DescriptionCtxOf ¶
func DescriptionCtxOf[T BothDescriptionCtxProvider](ctx context.Context, d T) string
func DescriptionOf ¶
func DescriptionOf[T BothDescriptionProvider](d T) string
func MapSliceSome ¶
func MaybeDescriptionOf ¶
func Sentencefy ¶
Types ¶
type ActionMetadata ¶
type ActionMetadata struct {
Schema ActionSchema
RenderOption *ActionRenderOption
}
type ActionMetadatas ¶
type ActionMetadatas map[string]ActionMetadata
type ActionRender ¶
type ActionRenderOption ¶
type ActionRenderOption struct {
// The subcategory of the document.
Subcategory string
Examples []Example
// A custom template that overrides the default template:
//
// {{ .Header }}
// {{ .Description }}
// {{- with .Example }}
// {{ . }}
// {{- end }}
// {{ .Schema }}
Template *template.Template
}
type ActionSchema ¶
type ActionSchema struct {
Description string
Deprecation string
Fields Fields
// Including nested attribute object or block object.
Nested NestedFields
}
func NewActionSchema ¶
func NewActionSchema(ctx context.Context, sch schema.Schema) (schema ActionSchema, diags diag.Diagnostics)
type ActionWithRenderOption ¶
type ActionWithRenderOption interface {
action.Action
RenderOption() ActionRenderOption
}
type BothDescriptionCtxProvider ¶
type BothDescriptionCtxProvider interface {
DescriptionCtxProvider
MarkdownDescriptionCtxProvider
}
type BothDescriptionProvider ¶
type BothDescriptionProvider interface {
DescriptionProvider
MarkdownDescriptionProvider
}
type Categorizer ¶
type Categorizer interface {
Category() Category
}
type DataSourceMetadata ¶
type DataSourceMetadata struct {
Schema DataSourceSchema
RenderOption *DataSourceRenderOption
}
type DataSourceMetadatas ¶
type DataSourceMetadatas map[string]DataSourceMetadata
type DataSourceRender ¶
type DataSourceRenderOption ¶
type DataSourceRenderOption struct {
// The subcategory of the document.
Subcategory string
Examples []Example
// A custom template that overrides the default template:
//
// {{ .Header }}
// {{ .Description }}
// {{- with .Example }}
// {{ . }}
// {{- end }}
// {{ .Schema }}
Template *template.Template
}
type DataSourceSchema ¶
type DataSourceSchema struct {
Description string
Deprecation string
Fields Fields
// Including nested attribute object or block object.
Nested NestedFields
}
func NewDataSourceSchema ¶
func NewDataSourceSchema(ctx context.Context, sch schema.Schema) (schema DataSourceSchema, diags diag.Diagnostics)
type DataSourceWithRenderOption ¶
type DataSourceWithRenderOption interface {
datasource.DataSource
RenderOption() DataSourceRenderOption
}
type DescriptionCtxProvider ¶
type DescriptionProvider ¶
type DescriptionProvider interface {
GetDescription() string
}
type EphemeralMetadata ¶
type EphemeralMetadata struct {
Schema EphemeralSchema
RenderOption *EphemeralRenderOption
}
type EphemeralMetadatas ¶
type EphemeralMetadatas map[string]EphemeralMetadata
type EphemeralRender ¶
type EphemeralRenderOption ¶
type EphemeralRenderOption struct {
// The subcategory of the document.
Subcategory string
Examples []Example
// A custom template that overrides the default template:
//
// {{ .Header }}
// {{ .Description }}
// {{- with .Example }}
// {{ . }}
// {{- end }}
// {{ .Schema }}
Template *template.Template
}
type EphemeralResourceWithRenderOption ¶
type EphemeralResourceWithRenderOption interface {
ephemeral.EphemeralResource
RenderOption() EphemeralRenderOption
}
type EphemeralSchema ¶
type EphemeralSchema struct {
Description string
Deprecation string
Fields Fields
// Including nested attribute object or block object.
Nested NestedFields
}
func NewEphemeralSchema ¶
func NewEphemeralSchema(ctx context.Context, sch schema.Schema) (schema EphemeralSchema, diags diag.Diagnostics)
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
func (Field) CustomTypeDescription ¶
func (Field) Deprecation ¶
func (Field) Description ¶
func (Field) NestedLink ¶
func (Field) PlanModifiers ¶
func (Field) Validators ¶
type Fields ¶
func (Fields) ComputedFields ¶
func (Fields) OptionalFields ¶
func (Fields) RequiredFields ¶
type FunctionField ¶
type FunctionField struct {
// contains filtered or unexported fields
}
func (FunctionField) AllowNull ¶
func (r FunctionField) AllowNull() bool
func (FunctionField) AllowUnknown ¶
func (r FunctionField) AllowUnknown() bool
func (FunctionField) CustomTypeDescription ¶
func (r FunctionField) CustomTypeDescription() string
func (FunctionField) DataType ¶
func (r FunctionField) DataType() DataType
func (FunctionField) Description ¶
func (r FunctionField) Description() string
func (FunctionField) Name ¶
func (r FunctionField) Name() string
func (FunctionField) NestedLink ¶
func (field FunctionField) NestedLink() string
func (FunctionField) Parents ¶
func (r FunctionField) Parents() []string
func (FunctionField) Traits ¶
func (field FunctionField) Traits() string
func (FunctionField) Validators ¶
func (r FunctionField) Validators() []string
type FunctionFields ¶
type FunctionFields []FunctionField
type FunctionMetadata ¶
type FunctionMetadata struct {
Schema FunctionSchema
RenderOption *FunctionRenderOption
}
type FunctionMetadatas ¶
type FunctionMetadatas map[string]FunctionMetadata
type FunctionObject ¶
type FunctionObject struct {
// contains filtered or unexported fields
}
func (FunctionObject) CustomTypeDescription ¶
func (r FunctionObject) CustomTypeDescription() string
type FunctionObjects ¶
type FunctionObjects map[string]FunctionObject
type FunctionRender ¶
type FunctionRenderOption ¶
type FunctionRenderOption struct {
// The subcategory of the document.
Subcategory string
Examples []Example
// Description of the return value.
ReturnDescription *string
// A custom template that overrides the default template:
//
// {{ .Header }}
// {{ .Description }}
// {{- with .Example }}
// {{ . }}
// {{- end }}
// {{ .Signature }}
// {{- with .Arguments }}
// {{ . }}
// {{- end }}
// {{- with .Return }}
// {{ . }}
// {{- end }}
Template *template.Template
}
type FunctionSchema ¶
type FunctionSchema struct {
Description string
Summary string
Deprecation string
Parameters FunctionFields
Objects FunctionObjects
Return FunctionField
ReturnObjects FunctionObjects
}
func NewFunctionSchema ¶
func NewFunctionSchema(ctx context.Context, sch function.Definition) (schema FunctionSchema, diags diag.Diagnostics)
type FunctionWithRenderOption ¶
type FunctionWithRenderOption interface {
function.Function
RenderOption() FunctionRenderOption
}
type ImportId ¶
type ImportId struct {
// The Id format.
Format string
// The example id that will be displayed in an example `terraform import` command.
// Note that the id is double quoted, ensure to escape any double quote included in the id.
ExampleId string
// The complete import by id block. If not specified, it will fill in the block with the `ExampleId`.
ExampleBlk string
}
type ListMetadata ¶
type ListMetadata struct {
Schema ListSchema
RenderOption *ListRenderOption
}
type ListMetadatas ¶
type ListMetadatas map[string]ListMetadata
type ListRender ¶
type ListRenderOption ¶
type ListRenderOption struct {
// The subcategory of the document.
Subcategory string
Examples []Example
// A custom template that overrides the default template:
//
// {{ .Header }}
// {{ .Description }}
// {{- with .Example }}
// {{ . }}
// {{- end }}
// {{ .Schema }}
Template *template.Template
}
type ListResourceWithRenderOption ¶
type ListResourceWithRenderOption interface {
list.ListResource
RenderOption() ListRenderOption
}
type ListSchema ¶
type ListSchema struct {
Description string
Deprecation string
Fields Fields
// Including nested attribute object or block object.
Nested NestedFields
}
func NewListSchema ¶
func NewListSchema(ctx context.Context, sch schema.Schema) (schema ListSchema, diags diag.Diagnostics)
type MarkdownDescriptionProvider ¶
type MarkdownDescriptionProvider interface {
GetMarkdownDescription() string
}
type Metadata ¶
type Metadata struct {
ProviderName string
Provider ProviderMetadata
Resources ResourceMetadatas
DataSources DataSourceMetadatas
Ephemerals EphemeralMetadatas
Actions ActionMetadatas
Lists ListMetadatas
Functions FunctionMetadatas
}
func GetMetadata ¶
func (Metadata) NewActionRender ¶
func (metadata Metadata) NewActionRender(actionType string, opt *ActionRenderOption) (*ActionRender, error)
func (Metadata) NewDataSourceRender ¶
func (metadata Metadata) NewDataSourceRender(dataSourceType string, opt *DataSourceRenderOption) (*DataSourceRender, error)
func (Metadata) NewEphemeralRender ¶
func (metadata Metadata) NewEphemeralRender(ephemeralType string, opt *EphemeralRenderOption) (*EphemeralRender, error)
func (Metadata) NewFunctionRender ¶
func (metadata Metadata) NewFunctionRender(functionName string, opt *FunctionRenderOption) (*FunctionRender, error)
func (Metadata) NewListRender ¶
func (metadata Metadata) NewListRender(listType string, opt *ListRenderOption) (*ListRender, error)
func (Metadata) NewProviderRender ¶
func (metadata Metadata) NewProviderRender(opt *ProviderRenderOption) (*ProviderRender, error)
func (Metadata) NewResourceRender ¶
func (metadata Metadata) NewResourceRender(resourceType string, opt *ResourceRenderOption) (*ResourceRender, error)
type NestedField ¶
type NestedField struct {
// contains filtered or unexported fields
}
func (NestedField) Fields ¶
func (r NestedField) Fields() Fields
func (NestedField) PlanModifiers ¶
func (r NestedField) PlanModifiers() []string
func (NestedField) Validators ¶
func (r NestedField) Validators() []string
type NestedFields ¶
type NestedFields map[string]NestedField
type ObjectField ¶
type ObjectField struct {
// contains filtered or unexported fields
}
func (ObjectField) ToField ¶
func (obj ObjectField) ToField(rootField Field) Field
func (ObjectField) ToFunctionField ¶
func (obj ObjectField) ToFunctionField() FunctionField
type Objects ¶
func (Objects) ToFunctionObjects ¶
func (objs Objects) ToFunctionObjects() FunctionObjects
func (Objects) ToNestedFields ¶
func (objs Objects) ToNestedFields(rootField Field) NestedFields
type ProviderMetadata ¶
type ProviderMetadata struct {
Schema ProviderSchema
RenderOption *ProviderRenderOption
}
type ProviderRender ¶
type ProviderRenderOption ¶
type ProviderSchema ¶
type ProviderSchema struct {
Description string
Deprecation string
Fields Fields
// Including nested attribute object or block object.
Nested NestedFields
}
func NewProviderSchema ¶
func NewProviderSchema(ctx context.Context, sch schema.Schema) (schema ProviderSchema, diags diag.Diagnostics)
type ProviderWithRenderOption ¶
type ProviderWithRenderOption interface {
provider.Provider
RenderOption() ProviderRenderOption
}
type ResourceIdentityField ¶
type ResourceIdentityField struct {
Name string
DataType DataType
Required bool
Optional bool
Description string
// contains filtered or unexported fields
}
func (ResourceIdentityField) CustomTypeDescription ¶
func (field ResourceIdentityField) CustomTypeDescription() string
func (ResourceIdentityField) Traits ¶
func (field ResourceIdentityField) Traits() string
type ResourceIdentityFields ¶
type ResourceIdentityFields map[string]ResourceIdentityField
func (ResourceIdentityFields) OptionalFields ¶
func (fields ResourceIdentityFields) OptionalFields() []ResourceIdentityField
func (ResourceIdentityFields) RequiredFields ¶
func (fields ResourceIdentityFields) RequiredFields() []ResourceIdentityField
type ResourceIdentitySchema ¶
type ResourceIdentitySchema struct {
Fields ResourceIdentityFields
}
func NewResourceIdentitySchema ¶
func NewResourceIdentitySchema(ctx context.Context, sch identityschema.Schema) (schema ResourceIdentitySchema, diags diag.Diagnostics)
type ResourceMetadata ¶
type ResourceMetadata struct {
Schema ResourceSchema
Identity *ResourceIdentitySchema
RenderOption *ResourceRenderOption
}
type ResourceMetadatas ¶
type ResourceMetadatas map[string]ResourceMetadata
type ResourceRender ¶
type ResourceRenderOption ¶
type ResourceRenderOption struct {
// The subcategory of the document.
Subcategory string
Examples []Example
// The information about import by id (including via command and via import block).
ImportId *ImportId
// The examples for importing by identity via import block.
IdentityExamples []Example
// A custom template that overrides the default template:
//
// {{ .Header }}
// {{ .Description }}
// {{- with .Example }}
// {{ . }}
// {{- end }}
// {{ .Schema }}
// {{- with .Import }}
// {{ . }}
// {{- end }}
Template *template.Template
}
type ResourceSchema ¶
type ResourceSchema struct {
Description string
Deprecation string
Fields Fields
// Including nested attribute object or block object.
Nested NestedFields
}
func NewResourceSchema ¶
func NewResourceSchema(ctx context.Context, sch schema.Schema) (schema ResourceSchema, diags diag.Diagnostics)
type ResourceWithRenderOption ¶
type ResourceWithRenderOption interface {
resource.Resource
RenderOption() ResourceRenderOption
}
Source Files
¶
- attr_object.go
- datatype.go
- field.go
- field_function.go
- field_identity.go
- metadata.go
- render_action.go
- render_datasource.go
- render_ephemeral.go
- render_function.go
- render_list.go
- render_provider.go
- render_resource.go
- renderbuilder_action.go
- renderbuilder_common.go
- renderbuilder_common_description.go
- renderbuilder_common_example.go
- renderbuilder_common_header.go
- renderbuilder_common_schema.go
- renderbuilder_datasource.go
- renderbuilder_ephemeral.go
- renderbuilder_function.go
- renderbuilder_list.go
- renderbuilder_provider.go
- renderbuilder_resource.go
- schema_action.go
- schema_datasource.go
- schema_ephemeral.go
- schema_function.go
- schema_list.go
- schema_provider.go
- schema_resource.go
- schema_resource_identity.go
- utils.go
Click to show internal directories.
Click to hide internal directories.