session

package
v0.0.0-...-f9bed8c Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertEqual

func AssertEqual(t *testing.T, exp, act *Session)

Types

type EventData

type EventData struct {
	Event string
	Data  any
}

type Session

type Session struct {
	Steps []*Step
	// contains filtered or unexported fields
}

func LoadFromFile

func LoadFromFile(file string) (*Session, error)

func New

func New() *Session

func (*Session) NewStep

func (s *Session) NewStep(name string)

func (*Session) RecordEvent

func (s *Session) RecordEvent(user *domain.User, event string, data any)

RecordEvent records an event for the current step Even if the event should not be recorded, the counter will increase

func (*Session) SaveToFile

func (s *Session) SaveToFile(file string) error

func (*Session) SaveToFileShortened

func (s *Session) SaveToFileShortened(file string) error

func (*Session) SetRecordEvents

func (s *Session) SetRecordEvents(events ...string)

func (*Session) UseShortener

func (s *Session) UseShortener(event string, sh Shortener)

func (*Session) WaitNResponses

func (s *Session) WaitNResponses(n uint32)

WaitNResponses waits for n responses to be recorded with Session.RecordEvent

type Shortener

type Shortener func(any) any

func EventShortener

func EventShortener[T any](f func(T) any) Shortener

type Step

type Step struct {
	Name   string
	Events map[string][]EventData
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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