typeconverter

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const TEMPLATE = `package main

import (
	m "{{ .ModuleName }}"
	"github.com/tkrajina/typescriptify-golang-structs/typescriptify"
)

func main() {
	t := typescriptify.New()
	t.CreateInterface = {{ .Interface }}
	t.BackupDir = ""
{{ range .Structs }}	t.Add({{ . }}{})
{{ end }}
{{ range .CustomImports }}	t.AddImport("{{ . }}")
{{ end }}
	err := t.ConvertToFile(` + "`{{ .TargetFile }}`" + `)
	if err != nil {
		panic(err.Error())
	}
}`

Variables

This section is empty.

Functions

func Start

func Start(structsFilePath, generatedTypesPath string) error

Start starts the type converter It gets the name of structs in PropsStructsPath and generates a temporary file to run the type converter

Types

type TemplateParams

type TemplateParams struct {
	ModuleName    string
	TargetFile    string
	Structs       []string
	InitParams    map[string]interface{}
	CustomImports arrayImports
	Interface     bool
	Verbose       bool
}

Jump to

Keyboard shortcuts

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