resource

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package resource is the seam between a component test and the external systems it runs against for real.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ephemeral

type Ephemeral interface {
	Down(ctx context.Context) error
}

type Fault

type Fault interface {
	FailWith(err error)
}

All a step gets of a resource: Provision and Reset belong to the suite.

type Named

type Named interface {
	Name() string
}

type Resource

type Resource interface {
	Provision(ctx context.Context) error
	Migrate(ctx context.Context) error
	Reset(ctx context.Context) error
}

type Set

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

Down ends the run: the once is not reset, so Up does not provision again.

func New

func New(resources ...Resource) *Set

func (*Set) Down

func (s *Set) Down(ctx context.Context) error

func (*Set) Reset

func (s *Set) Reset(ctx context.Context) error

Reset calls Up first, so a suite that only ever calls Reset is still correct.

func (*Set) Up

func (s *Set) Up(ctx context.Context) error

Jump to

Keyboard shortcuts

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