validation

package
v0.0.0-...-d4025e8 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindDestination

func FindDestination(srcPath string) string

FindDestination attempts to find a sensible destination file path. The file path is absolute.

func FormatAndWrite

func FormatAndWrite(bs []byte, destPath string) error

FormatAndWrite formats some generated Go source code (the input bs), and writes it to a file.

Types

type Generator

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

Generator is a type used to generate validation code.

func NewGenerator

func NewGenerator(constraints map[string]valley.ConstraintGenerator) *Generator

NewGenerator returns a new Generator instance.

func (*Generator) Generate

func (g *Generator) Generate(config valley.Config, source valley.Source, tagName string) ([]byte, error)

Generate attempts to generate the code (returned as bytes) to validate code in the given package, using the given configuration.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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