gen

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// The path to a configuration file in TOML format containing information
	// about the database objects that pggen should generate code for.
	ConfigFilePath string
	// The name of the file to which the output should be written.
	OutputFileName string
	// A list of postgres connection strings to be used to connect to the
	// database. They tried in order until one is found where `DB.Ping` works.
	ConnectionStrings []string
	// A list of var patterns which disable pggen when they match the environment.
	DisableVars []string
	// A list of var patterns which must match against the environment in order for
	// pggen to run.
	EnableVars []string
	// The verbosity level of the code generator. -1 means quiet mode,
	// 0 (the default) means normal mode, and 1 means verbose mode.
	Verbosity int
}

`pggen.Config` contains a collection of configuration options for the the codegenerator

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

An instantiation of a pggen codegenerator

func FromConfig

func FromConfig(config Config) (*Generator, error)

func (*Generator) Gen

func (g *Generator) Gen() error

Generate the code that this generator has been configured for

Directories

Path Synopsis
internal
log
package log provides some simple information level print helpers wrapped up in a lightweight struct that can be embedded in other objects
package log provides some simple information level print helpers wrapped up in a lightweight struct that can be embedded in other objects

Jump to

Keyboard shortcuts

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