extractor

package
v0.1.5-0...-d8fecb6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Copyright 2000-2017 JetBrains s.r.o. Copyright 2021 Evan Cleary

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2000-2017 JetBrains s.r.o. Copyright 2021 Evan Cleary

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	TimeoutCreate  = "create"
	TimeoutRead    = "read"
	TimeoutUpdate  = "update"
	TimeoutDelete  = "delete"
	TimeoutDefault = "default"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Extractor

type Extractor struct{}

func (*Extractor) DoGenerate

func (e *Extractor) DoGenerate(provider *schema.Provider, pi *ProviderInfo, outputFilePath string) error

func (*Extractor) Export

ExportSchema should be called to export the structure of the provider.

func (*Extractor) ExportResource

func (e *Extractor) ExportResource(r *schema.Resource) SchemaInfo

func (*Extractor) ExportResourceWithTimeouts

func (e *Extractor) ExportResourceWithTimeouts(r *schema.Resource) SchemaInfoWithTimeouts

func (*Extractor) Generate

func (e *Extractor) Generate(provider *schema.Provider, pi *ProviderInfo, outputPath string)

type ProviderInfo

type ProviderInfo struct {
	Name     string
	Revision string
}

type ResourceProviderSchema

type ResourceProviderSchema struct {
	Name          string                            `json:"name"`
	Type          string                            `json:"type"`
	Version       string                            `json:"version"`
	SDKType       string                            `json:".sdk_type"`
	SchemaVersion string                            `json:".schema_version"`
	Provider      SchemaInfo                        `json:"provider"`
	Resources     map[string]SchemaInfoWithTimeouts `json:"resources"`
	DataSources   map[string]SchemaInfoWithTimeouts `json:"data-sources"`
}

ResourceProviderSchema

type SchemaDefinition

type SchemaDefinition struct {
	Type               string `json:",omitempty"`
	Optional           bool   `json:",omitempty"`
	Required           bool   `json:",omitempty"`
	Description        string `json:",omitempty"`
	InputDefault       string `json:",omitempty"`
	Computed           bool   `json:",omitempty"`
	MaxItems           int    `json:",omitempty"`
	MinItems           int    `json:",omitempty"`
	PromoteSingle      bool   `json:",omitempty"`
	IsBlock            bool   `json:",omitempty"`
	ConfigImplicitMode string `json:",omitempty"`

	ComputedWhen  []string `json:",omitempty"`
	ConflictsWith []string `json:",omitempty"`

	Deprecated string `json:",omitempty"`
	Removed    string `json:",omitempty"`

	Default *SchemaElement `json:",omitempty"`
	Elem    *SchemaElement `json:",omitempty"`
}

type SchemaElement

type SchemaElement struct {
	// One of "schema.ValueType" or "SchemaElements" or "SchemaInfo"
	Type string `json:",omitempty"`
	// Set for simple types (from ValueType)
	Value string `json:",omitempty"`
	// Set if Type == "SchemaElements"
	ElementsType string `json:",omitempty"`
	// Set if Type == "SchemaInfo"
	Info SchemaInfo `json:",omitempty"`
}

type SchemaInfo

type SchemaInfo map[string]SchemaDefinition

type SchemaInfoWithTimeouts

type SchemaInfoWithTimeouts map[string]interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL