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 ¶
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.