Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Packages []*PackageConfig `yaml:"packages"`
}
func (Config) PackageConfig ¶
func (c Config) PackageConfig(packagePath string) *PackageConfig
func (Config) PackageNames ¶
type PackageConfig ¶
type PackageConfig struct {
// The package path just like you would import it in Go
Path string `yaml:"path"`
// Where this output should be written to.
// If you specify a folder it will be written to a file `index.ts` within that folder. By default it is written into the Golang package folder.
OutputPath string `yaml:"output_path"`
// Customize the indentation (use \t if you want tabs)
Indent string `yaml:"indent"`
// Specify your own custom type translations, useful for custom types, `time.Time` and `null.String`.
// Be default unrecognized types will be output as `any /* name */`.
TypeMappings map[string]string `yaml:"type_mappings"`
// This content will be put at the top of the output Typescript file.
// You would generally use this to import custom types.
Frontmatter string `yaml:"frontmatter"`
// Filenames of Go source files that should not be included in the Typescript output.
ExcludeFiles []string `yaml:"exclude_files"`
}
func (PackageConfig) IsFileIgnored ¶
func (c PackageConfig) IsFileIgnored(pathToFile string) bool
func (PackageConfig) ResolvedOutputPath ¶
func (c PackageConfig) ResolvedOutputPath(packageDir string) string
type PackageGenerator ¶
type PackageGenerator struct {
GoFiles []string
// contains filtered or unexported fields
}
Responsible for generating the code for an input package
func (*PackageGenerator) Generate ¶
func (g *PackageGenerator) Generate() (string, error)
type Tygo ¶
type Tygo struct {
// contains filtered or unexported fields
}
Generator for one or more input packages, responsible for linking them together if necessary.
func (*Tygo) SetTypeMapping ¶
Click to show internal directories.
Click to hide internal directories.