templates

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(name string) (check.Template, bool)

Get gets a template by name, returning a boolean indicating whether it was found.

func List

func List() []check.Template

List returns all known templates, sorted by name.

func Register

func Register(t check.Template)

Register registers a template with the given name. Intended to be called at program init time.

Types

type TemplateTestSuite

type TemplateTestSuite struct {
	suite.Suite

	Template check.Template
}

TemplateTestSuite is a basic testing suite for all templates test with some generic helper functions

func (*TemplateTestSuite) Init

func (s *TemplateTestSuite) Init(templateKey string)

Init initializes the test suite with a template

func (*TemplateTestSuite) Validate

func (s *TemplateTestSuite) Validate(
	ctx lintcontext.LintContext,
	cases []TestCase,
)

Validate validates the given test cases against the LintContext passed in.

type TestCase

type TestCase struct {
	Param                    interface{}
	Diagnostics              map[string][]diagnostic.Diagnostic
	ExpectInstantiationError bool
}

TestCase represents a single test case which can be verified under a LintContext

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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