fixtures

package
v0.2202.3 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrMissingFixture is the error returned when getting a nonexisting fixture.
	ErrMissingFixture = fmt.Errorf("fixture does not exist")
)

Functions

func Register

func Register(fixture Fixture)

Register registers a new fixture.

Types

type Fixture

type Fixture interface {
	// Name is the name of the fixture.
	Name() string

	// Populate populates the db with the fixture.
	Populate(context.Context, db.NodeDB) (*node.Root, error)
}

Fixture is a protocol server fixture.

func GetFixture

func GetFixture(name string) (Fixture, error)

GetFixture returns a registered fixture by name.

Jump to

Keyboard shortcuts

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