feat: Add ResetCircuitBreaker helper

This commit is contained in:
2026-08-16 03:41:26 +03:00
parent 26c4be2d3a
commit 286cb8653a
4 changed files with 70 additions and 6 deletions

View File

@@ -9,12 +9,24 @@ type Edge struct {
Kind EdgeKind
Duration int // travel time in seconds
Transport string // transport type (train, plane, bus)
TransportType string // deprecated: use Transport instead
TransportType TransportType // transport type enum
IsTransfer bool // whether this edge involves a transfer
Departure string // ISO 8601 departure time
Arrival string // ISO 8601 arrival time
}
// TransportType represents the type of transport for an edge.
type TransportType string
const (
// TransportTypePlane represents airplane transport.
TransportTypePlane TransportType = "plane"
// TransportTypeTrain represents train transport.
TransportTypeTrain TransportType = "train"
// TransportTypeBus represents bus transport.
TransportTypeBus TransportType = "bus"
)
// NodeType represents the type of a graph node.
type NodeType int
@@ -129,6 +141,7 @@ func BuildGraphFromStations(stations []StationInfo) *Graph {
Kind: EdgeKindSynthetic,
Duration: 300, // 5 min synthetic transfer
Transport: "train",
TransportType: TransportTypeTrain,
IsTransfer: true,
})
@@ -139,6 +152,7 @@ func BuildGraphFromStations(stations []StationInfo) *Graph {
Kind: EdgeKindSynthetic,
Duration: 300, // 5 min synthetic transfer
Transport: "train",
TransportType: TransportTypeTrain,
IsTransfer: true,
})
}