ncloud

package
v0.0.0-...-1c38d6a Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CreateTemplate string
View Source
var DeleteTemplate string
View Source
var ImportStateTemplate string
View Source
var InitialTemplate string
View Source
var ModelTemplate string
View Source
var ReadTemplate string
View Source
var RefreshTemplate string
View Source
var TestTemplate string
View Source
var UpdateTemplate string
View Source
var WaitTemplate string

Functions

func CamelToPascalCase

func CamelToPascalCase(s string) string

func GenArray

func GenArray(d resource.Attributes, pName string) string

func GenObject

func GenObject(d resource.Attributes, pName string) string

func Gen_ConvertOAStoTFTypes

func Gen_ConvertOAStoTFTypes(data resource.Attributes) (string, string, error)

generate converter that convert openapi.json schema to terraform type

func MakeImportStateLogic

func MakeImportStateLogic(target string) string

func NcloudParse

func NcloudParse(ctx context.Context, document []byte) (util.NcloudSpecification, error)

Parse returns a Specification from the JSON document contents, or any validation errors.

func PascalToSnakeCase

func PascalToSnakeCase(s string) string

func WriteNcloudDataSourceTests

func WriteNcloudDataSourceTests(dataSourcesSchema map[string][]byte, spec util.NcloudSpecification, outputDir, packageName string) error

WriteDataSources uses the packageName to determine whether to create a directory and package per data source. If packageName is an empty string, this indicates that the flag was not set, and the default behaviour is then to create a package and directory per data source. If packageName is set then all generated code is placed into the same directory and package.

func WriteNcloudDataSources

func WriteNcloudDataSources(dataSourcesSchema map[string][]byte, spec util.NcloudSpecification, outputDir, packageName string) error

WriteDataSources uses the packageName to determine whether to create a directory and package per data source. If packageName is an empty string, this indicates that the flag was not set, and the default behaviour is then to create a package and directory per data source. If packageName is set then all generated code is placed into the same directory and package.

func WriteNcloudResourceTests

func WriteNcloudResourceTests(resourcesSchema map[string][]byte, spec util.NcloudSpecification, outputDir, packageName string) error

WriteResources uses the packageName to determine whether to create a directory and package per resource. If packageName is an empty string, this indicates that the flag was not set, and the default behaviour is then to create a package and directory per resource. If packageName is set then all generated code is placed into the same directory and package. CORE - 여기에 줄을 추가하여 생성하는 것으로 한다.

func WriteNcloudResources

func WriteNcloudResources(resourcesSchema map[string][]byte, spec util.NcloudSpecification, outputDir, packageName string) error

Types

type Template

type Template struct {
	// contains filtered or unexported fields
}

To generate actual data, extract data from config.yml and code-spec.json, and render code for each receiver based on that data. New(): Extracts the data needed for code generation. Currently, it extracts data from config.yml and code-spec.json, but it is planned to unify everything into code-spec.json in the future. RenderInitial(): Generates small code blocks needed initially. RenderCreate(): Generates the Create function. RenderRead(): Generates the Read function. RenderUpdate(): Generates the Update function. RenderDelete(): Generates the Delete function. Calculates the necessary data during initialization and performs rendering for each method.

func New

func New(spec util.NcloudSpecification, resourceName string) *Template

초기화를 통해 필요한 데이터들을 미리 계산한다.

func (*Template) RenderCreate

func (t *Template) RenderCreate() []byte

func (*Template) RenderDelete

func (t *Template) RenderDelete() []byte

func (*Template) RenderImportState

func (t *Template) RenderImportState() []byte

func (*Template) RenderInitial

func (t *Template) RenderInitial() []byte

func (*Template) RenderModel

func (t *Template) RenderModel() []byte

func (*Template) RenderRead

func (t *Template) RenderRead() []byte

func (*Template) RenderRefresh

func (t *Template) RenderRefresh() []byte

func (*Template) RenderTest

func (t *Template) RenderTest() []byte

func (*Template) RenderUpdate

func (t *Template) RenderUpdate() []byte

func (*Template) RenderWait

func (t *Template) RenderWait() []byte

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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