Documentation
ยถ
Index ยถ
- func Example(di *dix.Dix)
- func RegisterGroupRules(rules ...GroupRule)
- type DependencyData
- type EdgeInfo
- type GroupRule
- type IssueInfo
- type ObjectInfo
- type PackageDetailsData
- type PackageInfo
- type ProviderInfo
- type ResolvedCount2
- type Server
- func (s *Server) HandleDependencies(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleDiagnostics(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleEgo(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleErrors(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleGroupRules(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleIndex(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleIssues(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleModule(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleModules(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandlePackageDetails(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandlePackages(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleRuntimeStats(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleSearch(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleStats(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleTrace(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleTraceTree(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleTypeDetails(w http.ResponseWriter, r *http.Request)
- func (s *Server) ListenAndServe(addr string) error
- func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type ServerOption
- type StatsData
- type TypeDetailsData
- type TypeNode
Constants ยถ
This section is empty.
Variables ยถ
This section is empty.
Functions ยถ
func RegisterGroupRules ยถ
func RegisterGroupRules(rules ...GroupRule)
RegisterGroupRules registers global group rules for visualization. This can be called by business code to predefine group rules.
Types ยถ
type DependencyData ยถ
type DependencyData struct {
Providers []ProviderInfo `json:"providers"`
Objects []ObjectInfo `json:"objects"`
Edges []EdgeInfo `json:"edges"`
}
DependencyData represents the structure of dependency information
type EdgeInfo ยถ
type EdgeInfo struct {
From string `json:"from"`
To string `json:"to"`
Type string `json:"type"` // "provider", "object", "dependency"
}
EdgeInfo represents a dependency relationship
type IssueInfo ยถ added in v2.2.0
type IssueInfo struct {
Severity string `json:"severity"`
Kind string `json:"kind"`
ProviderID string `json:"provider_id,omitempty"`
Provider string `json:"provider,omitempty"`
OutputType string `json:"output_type,omitempty"`
Module string `json:"module,omitempty"`
Title string `json:"title"`
RootCause string `json:"root_cause,omitempty"`
Hint string `json:"hint,omitempty"`
TraceID string `json:"trace_id,omitempty"`
OccurredAtUnixNano int64 `json:"occurred_at_unix_nano,omitempty"`
}
IssueInfo is one actionable diagnostic item with a stable link back to the graph/trace.
type ObjectInfo ยถ
type ObjectInfo struct {
ID string `json:"id"`
Type string `json:"type"`
Group string `json:"group"`
IsInitialized bool `json:"is_initialized"`
}
ObjectInfo contains information about an object instance
type PackageDetailsData ยถ
type PackageDetailsData struct {
Package string `json:"package"`
Providers []ProviderInfo `json:"providers"`
Edges []EdgeInfo `json:"edges"`
}
PackageDetailsData contains detailed information for a package
type PackageInfo ยถ
type PackageInfo struct {
Name string `json:"name"`
ProviderCount int `json:"provider_count"`
Types []string `json:"types"`
}
PackageInfo contains information about a package
type ProviderInfo ยถ
type ProviderInfo struct {
ID string `json:"id"`
RegistrationID uint64 `json:"registration_id"`
ProviderIDs []string `json:"provider_ids"`
OutputType string `json:"output_type"`
OutputTypes []string `json:"output_types,omitempty"`
OutputPkg string `json:"output_pkg"`
FunctionName string `json:"function_name"`
FunctionPkg string `json:"function_pkg"`
FunctionFile string `json:"function_file"`
FunctionLine int `json:"function_line"`
InputTypes []string `json:"input_types"`
InputPkgs []string `json:"input_pkgs"`
}
ProviderInfo contains information about a provider
type ResolvedCount2 ยถ added in v2.2.0
ResolvedCount2 ๆฏ dixhttp ๅฏนๅ ้จๅๆ่ฎกๆฐ็ฑปๅ็ๆๅฝฑใ
type Server ยถ
type Server struct {
// contains filtered or unexported fields
}
Server provides HTTP endpoints to visualize dependency relationships
func NewServerWithOptions ยถ
func NewServerWithOptions(di *dix.Dix, opts ...ServerOption) *Server
NewServerWithOptions creates a new HTTP server with options.
func (*Server) HandleDependencies ยถ
func (s *Server) HandleDependencies(w http.ResponseWriter, r *http.Request)
func (*Server) HandleDiagnostics ยถ
func (s *Server) HandleDiagnostics(w http.ResponseWriter, r *http.Request)
HandleDiagnostics returns records from DIX_DIAG_FILE (JSONL). Query params: - kind: trace|error (optional) - event: trace event fuzzy match (optional) - q: full-text search over record JSON (optional) - limit: optional positive integer, default 200, max 2000 - before_id: optional record id cursor for older-page query - since_unix_nano: optional lower time bound - until_unix_nano: optional upper time bound
func (*Server) HandleEgo ยถ added in v2.2.0
func (s *Server) HandleEgo(w http.ResponseWriter, r *http.Request)
HandleEgo ่ฟๅไปฅ center ไธบไธญๅฟ็ N ่ทณ้ปๅๅญๅพใ Query params: - center: ็ฑปๅ label(ๅฟ ๅกซ) - depth: ็ผบ็ 2,ไธ้ 10 - direction: both|deps|dependents,็ผบ็ both
func (*Server) HandleErrors ยถ
func (s *Server) HandleErrors(w http.ResponseWriter, r *http.Request)
HandleErrors returns recent Inject/TryInject error events. Query params: - limit: optional positive integer to limit returned rows.
func (*Server) HandleGroupRules ยถ
func (s *Server) HandleGroupRules(w http.ResponseWriter, r *http.Request)
HandleGroupRules returns global group rules for visualization.
func (*Server) HandleIndex ยถ
func (s *Server) HandleIndex(w http.ResponseWriter, r *http.Request)
HandleIndex serves the HTML visualization page
func (*Server) HandleIssues ยถ added in v2.2.0
func (s *Server) HandleIssues(w http.ResponseWriter, r *http.Request)
HandleIssues merges injection failures, provider failures, and slow providers into one issue-first diagnostic feed.
func (*Server) HandleModule ยถ added in v2.2.0
func (s *Server) HandleModule(w http.ResponseWriter, r *http.Request)
HandleModule returns a bounded provider/type topology for one module. Query params: - name: exact module/package path (required) - limit: max nodes, default 100, max 500 - edge_limit: max edges, default 300, max 1000
func (*Server) HandleModules ยถ added in v2.2.0
func (s *Server) HandleModules(w http.ResponseWriter, r *http.Request)
HandleModules ่ฟๅๆจกๅ็บง่ๅ่งๅพ(ๅซ่ทจๆจกๅไพ่ต)ใ
func (*Server) HandlePackageDetails ยถ
func (s *Server) HandlePackageDetails(w http.ResponseWriter, r *http.Request)
HandlePackageDetails returns details for a specific package
func (*Server) HandlePackages ยถ
func (s *Server) HandlePackages(w http.ResponseWriter, r *http.Request)
HandlePackages returns list of packages for navigation
func (*Server) HandleRuntimeStats ยถ
func (s *Server) HandleRuntimeStats(w http.ResponseWriter, r *http.Request)
HandleRuntimeStats returns provider runtime stats for startup/perf diagnosis. Query params: - limit: optional positive integer to limit returned rows.
func (*Server) HandleSearch ยถ added in v2.2.0
func (s *Server) HandleSearch(w http.ResponseWriter, r *http.Request)
HandleSearch ๆฃ็ดขๅพ่็นใ Query params: - q: ๅ ณ้ฎๅญ(็ฑปๅๅ/ๅฝๆฐๅๅ ๅซๅน้ ) - kind: type|provider|object - module: pkg ๅ็ผ - state: instantiated|error|slow - limit: ็ผบ็ 50,ไธ้ 500
func (*Server) HandleStats ยถ
func (s *Server) HandleStats(w http.ResponseWriter, r *http.Request)
HandleStats returns summary statistics
func (*Server) HandleTrace ยถ
func (s *Server) HandleTrace(w http.ResponseWriter, r *http.Request)
HandleTrace returns in-memory dixtrace events. Query params: - trace_id, operation, status, event, component, provider, output_type, q - limit, before_id, since_unix_nano, until_unix_nano
func (*Server) HandleTraceTree ยถ added in v2.2.0
func (s *Server) HandleTraceTree(w http.ResponseWriter, r *http.Request)
HandleTraceTree returns the nested call tree of one trace. Query params: - trace_id: required trace id.
func (*Server) HandleTypeDetails ยถ
func (s *Server) HandleTypeDetails(w http.ResponseWriter, r *http.Request)
HandleTypeDetails returns dependency details for a specific type
func (*Server) ListenAndServe ยถ
ListenAndServe starts the HTTP server on the specified address
type ServerOption ยถ
type ServerOption func(*Server)
ServerOption customizes the HTTP server behavior.
func WithBasePath ยถ
func WithBasePath(basePath string) ServerOption
WithBasePath sets an optional URL prefix for all routes. Example: "/dix".
type StatsData ยถ
type StatsData struct {
ProviderCount int `json:"provider_count"`
ObjectCount int `json:"object_count"`
PackageCount int `json:"package_count"`
EdgeCount int `json:"edge_count"`
// ๆฆ่งๅขๅผบ(P4a):ๆจกๅๆฐใ่งฃๆ็ญๅบฆ TopNใๆ
ข/้่ฏฏ provider
Modules int `json:"modules"`
TopResolved []ResolvedCount2 `json:"top_resolved,omitempty"`
SlowProviders []string `json:"slow_providers,omitempty"`
ErrorProviders []string `json:"error_providers,omitempty"`
}
StatsData contains summary statistics