translators

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeScriptTranslationMode = "typescript"
	TSTranslationMode         = "ts"
	SwiftTranslationMode      = "swift"
	JSONTranslationMode       = "json"
	PHPTranslationMode        = "php"
)
View Source
const (
	StructTypeKeyWord = "struct"
)

Variables

This section is empty.

Functions

func GetPHPCompatibleType added in v1.1.0

func GetPHPCompatibleType(goType string, isPointer bool) string

func GetSwiftCompatibleType

func GetSwiftCompatibleType(goType string, isPointer bool) string

func GetTypescriptCompatibleType

func GetTypescriptCompatibleType(goType string, isPointer bool) string

func IsEmbeddedStructForInheritance

func IsEmbeddedStructForInheritance(field *godmt.ScannedStructField) bool

func MapValuesToPHPArray added in v1.1.0

func MapValuesToPHPArray(rawMap map[string]string) string

func MapValuesToTypeScriptRecord

func MapValuesToTypeScriptRecord(rawMap map[string]string) string

func TransformSliceTypeToPHP added in v1.1.0

func TransformSliceTypeToPHP(rawSliceType string, isPointer bool) string

func TransformSliceTypeToSwift

func TransformSliceTypeToSwift(rawSliceType string, isPointer bool) string

func TransformSliceTypeToTypeScript

func TransformSliceTypeToTypeScript(rawSliceType string, isPointer bool) string

func TransformSwiftRecord added in v1.2.0

func TransformSwiftRecord(goMapType string, isPointer bool) string

func TransformTypeScriptRecord added in v1.2.0

func TransformTypeScriptRecord(goMapType string, isPointer bool) string

Types

type JSONTranslator

type JSONTranslator struct {
	Translator
}

func (*JSONTranslator) Translate

func (t *JSONTranslator) Translate() string

type PHPTranslator added in v1.1.0

type PHPTranslator struct {
	Translator
}

func (*PHPTranslator) Translate added in v1.1.0

func (t *PHPTranslator) Translate() string

type ScannedRecordItem added in v1.2.0

type ScannedRecordItem struct {
	Kind       string
	IsMapSlice bool
}

type SwiftTranslator

type SwiftTranslator struct {
	Translator
}

func (*SwiftTranslator) Translate

func (t *SwiftTranslator) Translate() string

type Translator

type Translator struct {
	Preserve bool
	Data     syntaxtree.FileResult
}

type TypeScriptTranslator

type TypeScriptTranslator struct {
	Translator
}

func (*TypeScriptTranslator) Translate

func (t *TypeScriptTranslator) Translate() string

type TypeTranslator

type TypeTranslator interface {
	Translate() string
	Setup(d []godmt.ScannedType)
}

Jump to

Keyboard shortcuts

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