atgen

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	Yaml                   string
	Template               string
	TemplateDir            string
	OutputDir              string
	TestFuncs              TestFuncs
	TestFuncsPerAPIVersion map[string]TestFuncs
}

Generator is the type for code generator

func (*Generator) Generate

func (g *Generator) Generate() error

Generate generates code and write to files

func (*Generator) ParseYaml

func (g *Generator) ParseYaml() error

ParseYaml parses yaml which deifnes test requests/responses and convert it to types defined in types.go

type Req

type Req struct {
	Params  map[string]interface{}
	Headers map[string]string
}

Req is a request parameters and headers which a test should throw

type Res

type Res struct {
	Status  int
	Params  map[string]interface{}
	Headers map[string]string
}

Res is a response status, parameters and headers which a test should get

type Subtest

type Subtest struct {
	Name        string
	Tests       []Test
	APIVersions []string
}

Subtest reppresents a subtest

type Subtests

type Subtests []Subtest

Subtests is a group of Subtest

func (Subtests) IsSubtests

func (t Subtests) IsSubtests() bool

IsSubtests returns true when t is Subtests

type Test

type Test struct {
	APIVersions []string
	Path        string
	Method      string
	Req         Req
	Res         Res
	Vars        map[string]interface{}
}

Test represents a test in a test function

func (Test) IsSubtests

func (t Test) IsSubtests() bool

IsSubtests returns false when t is Test

type TestFunc

type TestFunc struct {
	Name        string
	Tests       []Tester
	APIVersions []string
	Vars        map[string]interface{}
}

TestFunc represents a test function

type TestFuncs

type TestFuncs []TestFunc

TestFuncs is a group of TestFunc

type Tester

type Tester interface {
	IsSubtests() bool
}

Tester is an interface for Test and Subtest

Jump to

Keyboard shortcuts

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