poly

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v0.0.3

type Client struct {
	Loader    source.Loader
	Generator generator.Generator
	Logf      func(format string, args ...any)
}

Client is the main component of the application. It takes source.Loader and codegen.Generator

func NewClient added in v0.0.3

func NewClient(c *Config) (*Client, error)

func (*Client) Run added in v0.0.3

func (r *Client) Run(ctx context.Context, c *config.Config) error

Run is the entry point of the application. Takes context.Context and config.Config and uses that to generate the tasks for the codegen.Generator.

Codegen files will be created in the corresponding packages that is because if your config.TypesList contain polymorphic fields, codegen.Generator needs to create custom UnmarshalJSON methods for those.

If multiple output files have been provided and the types are located in the same package, then declarations will be split between those files. If multiple types share the same output file but are located in the same package declarations will be created in the same file.

type Config added in v0.0.3

type Config struct {
	SourceLoader  source.Loader
	CodeGenerator generator.Generator
	Logf          func(format string, args ...any)
}

Jump to

Keyboard shortcuts

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