gen

package
v0.0.0-...-d191b88 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2020 License: BSD-3-Clause, MIT Imports: 13 Imported by: 0

Documentation

Overview

Package gen generates Go parser code from a trunnel AST.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CorpusTests

func CorpusTests(pkg string, c *tv.Corpus) ([]byte, error)

CorpusTests generates a test file based on a corpus of test vectors.

func Fuzzers

func Fuzzers(pkg string, c *tv.Corpus) ([]byte, error)

Fuzzers generates fuzzing functions for the types in the corpus.

func Marshallers

func Marshallers(pkg string, fs []*ast.File) ([]byte, error)

Marshallers builds data marshallers for types in the given files.

func Package

func Package(cfg Config, fs []*ast.File) error

Package generates a Go package for the given files.

Types

type Config

type Config struct {
	Package string // package name
	Dir     string // directory to output to
	Seed    int64  // seed for corpus generation
}

Config defines options for package generation.

func (Config) OutputDirectory

func (c Config) OutputDirectory() string

OutputDirectory returns the configured output directory.

func (Config) PackageName

func (c Config) PackageName() string

PackageName returns the name of the generated package.

func (Config) Path

func (c Config) Path(rel string) string

Path returns a path to rel within the configured output directory.

Directories

Path Synopsis
tests
eos
pos
rem

Jump to

Keyboard shortcuts

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