linker

package
v0.0.0-...-f5fd88d Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package linker provides a linker to add links between examples

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LinkedExample

type LinkedExample struct {
	*parser.Example
	Name     string
	Children []*LinkedExample
	Parents  []*LinkedExample
	// contains filtered or unexported fields
}

LinkedExample represents parser.Example with links

func NewLinkedExample

func NewLinkedExample(root string, e *parser.Example) *LinkedExample

NewLinkedExample creates new linked example based on parser.Example

func (*LinkedExample) Dependencies

func (e *LinkedExample) Dependencies() []string

Dependencies returns unique dependecies for this example

func (*LinkedExample) IsLeaf

func (e *LinkedExample) IsLeaf() bool

IsLeaf returns true if the example have not children and is not using as a dependency

func (*LinkedExample) ParentDependencies

func (e *LinkedExample) ParentDependencies() []string

ParentDependencies returns suites to setup before this example

type Linker

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

Linker can add links between examples

func New

func New(root string) *Linker

New creates new Linker instance

func (l *Linker) Link(examples ...*parser.Example) ([]*LinkedExample, error)

Link adds all possible links between examples. Return error if any link is invalid

Jump to

Keyboard shortcuts

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