convert

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package convert provides a function to generate conversion functions for a vehicle struct.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(tmplData *schema.TemplateData, outputDir string, cfg Config) (err error)

Generate creates a conversion functions for each field of a model struct. as well as the entire model struct.

Types

type Config

type Config struct {
	// CopyComments determines if comments for the conversion functions should be copied through.
	CopyComments bool
	// PackageName is the name of the package to generate the conversion functions.
	// This is separate from the model package name.
	// if empty, the model package name is used.
	PackageName string
	// OutputDir is the output directory for the generated conversion files.
	// if empty, the base output directory is used.
	OutputDir string
}

Config is the configuration for the conversion generator.

Jump to

Keyboard shortcuts

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