debug

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StaticFS embed.FS

Functions

func HasRunDebugFlag added in v1.6.1

func HasRunDebugFlag() bool

HasCLIFlag checks whether --ioc:run_debug is present in os.Args.

func Setup added in v1.6.1

func Setup(opts ...DebugOption) ([]app.SettingOption, error)

Setup creates the debug infrastructure, starts the debug server, opens the browser, and returns the app.SettingOption slice to apply. It also auto-detects the --ioc:dry_run CLI flag.

Types

type Collector

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

func NewCollector

func NewCollector() *Collector

func (*Collector) AddEdge

func (c *Collector) AddEdge(edge DependencyEdge)

func (*Collector) GetComponents

func (c *Collector) GetComponents() []componentInfo

func (*Collector) GetEvents

func (c *Collector) GetEvents() []DebugEvent

func (*Collector) GetGraph

func (c *Collector) GetGraph() GraphData

func (*Collector) RecordEvent

func (c *Collector) RecordEvent(event DebugEvent)

func (*Collector) RegisterComponent

func (c *Collector) RegisterComponent(name, typeName string)

func (*Collector) SetState

func (c *Collector) SetState(name string, state ComponentState)

type ComponentState

type ComponentState string
const (
	StateRegistered   ComponentState = "registered"
	StateScanned      ComponentState = "scanned"
	StateCreating     ComponentState = "creating"
	StatePopulating   ComponentState = "populating"
	StateInitializing ComponentState = "initializing"
	StateReady        ComponentState = "ready"
)

type Controller

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

func NewController

func NewController() *Controller

func (*Controller) Close

func (c *Controller) Close()

func (*Controller) GetBreakpoints

func (c *Controller) GetBreakpoints() map[string]bool

func (*Controller) GetMode

func (c *Controller) GetMode() StepMode

func (*Controller) Next

func (c *Controller) Next()

Next signals the factory to proceed one step.

func (*Controller) SetBreakpoint

func (c *Controller) SetBreakpoint(component string, enabled bool)

func (*Controller) SetMode

func (c *Controller) SetMode(mode StepMode)

func (*Controller) ShouldPause

func (c *Controller) ShouldPause(componentName string) bool

func (*Controller) WaitForNext

func (c *Controller) WaitForNext()

WaitForNext blocks until the user signals to proceed or mode is Run.

type DebugEvent

type DebugEvent struct {
	ID            int            `json:"id"`
	Phase         string         `json:"phase"`
	Action        string         `json:"action"`
	ComponentName string         `json:"componentName,omitempty"`
	ProcessorName string         `json:"processorName,omitempty"`
	Details       map[string]any `json:"details,omitempty"`
	Timestamp     time.Time      `json:"timestamp"`
}

type DebugFactory

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

func (*DebugFactory) Close

func (df *DebugFactory) Close()

func (*DebugFactory) GetComponentByName

func (df *DebugFactory) GetComponentByName(name string) (any, error)

func (*DebugFactory) GetComponents

func (df *DebugFactory) GetComponents(opts ...container.Option) ([]any, error)

func (*DebugFactory) GetConfigure

func (df *DebugFactory) GetConfigure() configure.Configure

func (*DebugFactory) GetDefinitionRegistry

func (df *DebugFactory) GetDefinitionRegistry() container.DefinitionRegistry

func (*DebugFactory) GetDefinitionRegistryPostProcessors

func (df *DebugFactory) GetDefinitionRegistryPostProcessors() []container.DefinitionRegistryPostProcessor

func (*DebugFactory) GetRegisteredComponents

func (df *DebugFactory) GetRegisteredComponents() map[string]any

func (*DebugFactory) PrepareComponents

func (df *DebugFactory) PrepareComponents() error

func (*DebugFactory) Refresh

func (df *DebugFactory) Refresh() error

func (*DebugFactory) SetConfigure

func (df *DebugFactory) SetConfigure(c configure.Configure)

func (*DebugFactory) SetContext

func (df *DebugFactory) SetContext(ctx context.Context)

func (*DebugFactory) SetRegistry

func (df *DebugFactory) SetRegistry(r container.SingletonRegistry)

type DebugOption added in v1.6.1

type DebugOption func(*DebugFactory)

func WithDryRun added in v1.6.1

func WithDryRun() DebugOption

type DependencyEdge

type DependencyEdge struct {
	From      string `json:"from"`
	To        string `json:"to"`
	FieldName string `json:"fieldName"`
	DepType   string `json:"depType"` // "pointer" or "interface"
}

type GraphData

type GraphData struct {
	Nodes []GraphNode      `json:"nodes"`
	Edges []DependencyEdge `json:"edges"`
}

type GraphNode

type GraphNode struct {
	Name  string         `json:"name"`
	Type  string         `json:"type"`
	State ComponentState `json:"state"`
}

type Server

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

func NewServer

func NewServer(controller *Controller, collector *Collector, staticFS fs.FS) *Server

func (*Server) Addr

func (s *Server) Addr() string

func (*Server) BroadcastEvent

func (s *Server) BroadcastEvent(event DebugEvent)

BroadcastEvent sends a debug event to all connected SSE clients.

func (*Server) Start

func (s *Server) Start() (string, error)

type StepMode

type StepMode int
const (
	ModeStepAll     StepMode = iota // Pause at every event
	ModeStepWatched                 // Only pause at breakpoint components
	ModeRun                         // Run without pausing
)

Jump to

Keyboard shortcuts

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