Documentation ¶
Index ¶
- Variables
- func CamelToPascalCase(s string) string
- func GenArray(d resource.Attributes, pName string) string
- func GenObject(d resource.Attributes, pName string) string
- func Gen_ConvertOAStoTFTypes(data resource.Attributes) (string, string, error)
- func MakeImportStateLogic(target string) string
- func NcloudParse(ctx context.Context, document []byte) (util.NcloudSpecification, error)
- func PascalToSnakeCase(s string) string
- func WriteNcloudDataSourceTests(dataSourcesSchema map[string][]byte, spec util.NcloudSpecification, ...) error
- func WriteNcloudDataSources(dataSourcesSchema map[string][]byte, spec util.NcloudSpecification, ...) error
- func WriteNcloudResourceTests(resourcesSchema map[string][]byte, spec util.NcloudSpecification, ...) error
- func WriteNcloudResources(resourcesSchema map[string][]byte, spec util.NcloudSpecification, ...) error
- type Template
- func (t *Template) RenderCreate() []byte
- func (t *Template) RenderDelete() []byte
- func (t *Template) RenderImportState() []byte
- func (t *Template) RenderInitial() []byte
- func (t *Template) RenderModel() []byte
- func (t *Template) RenderRead() []byte
- func (t *Template) RenderRefresh() []byte
- func (t *Template) RenderTest() []byte
- func (t *Template) RenderUpdate() []byte
- func (t *Template) RenderWait() []byte
Constants ¶
This section is empty.
Variables ¶
var CreateTemplate string
var DeleteTemplate string
var ImportStateTemplate string
var InitialTemplate string
var ModelTemplate string
var ReadTemplate string
var RefreshTemplate string
var TestTemplate string
var UpdateTemplate string
var WaitTemplate string
Functions ¶
func CamelToPascalCase ¶
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 NcloudParse ¶
Parse returns a Specification from the JSON document contents, or any validation errors.
func PascalToSnakeCase ¶
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 ¶
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
초기화를 통해 필요한 데이터들을 미리 계산한다.