session

package
v0.0.0-...-b3e7a07 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: Apache-2.0 Imports: 3 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CleanupFunc

type CleanupFunc func() error

CleanupFunc is the type RegisterCleanupFunc accepts

type Session

type Session struct {
	CleanupEnabled bool
	// contains filtered or unexported fields
}

Session is used to track resources created by tests by having a LIFO queue the keeps track of the delete functions.

func NewSession

func NewSession() *Session

NewSession is a constructor instantiates a new `Session`

func (*Session) Cleanup

func (ts *Session) Cleanup()

Cleanup this method will call all registered cleanup functions in order and close the test session.

func (*Session) NewSession

func (ts *Session) NewSession() *Session

NewSession returns a `Session` who's cleanup method is registered with this `Session`

func (*Session) RegisterCleanupFunc

func (ts *Session) RegisterCleanupFunc(f CleanupFunc)

RegisterCleanupFunc is function registers clean up functions in the `Session` queue. Functions passed to this method will be called in the order they are added when `Cleanup` is called. If Session is closed, it will cause a panic if a new cleanup function is registered.

Jump to

Keyboard shortcuts

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