Files
zeekay 285bb5a76b rename: ziti → zt across all paths
- Repo names: ziti-* → zt-*
- Go modules: github.com/hanzozt/ziti → github.com/hanzozt/zt
- Docker images: hanzozt/ziti-* → hanzozt/zt-*
- C/Java/JS symbols: ziti_* → zt_*
- File and directory names updated
2026-02-18 18:34:10 -08:00

40 lines
1.0 KiB
Go

package zt
import (
"github.com/hanzozt/metrics"
"github.com/hanzozt/sdk-golang/xgress"
)
type xgEnv struct {
retransmitter *xgress.Retransmitter
payloadIngester *xgress.PayloadIngester
metrics xgress.Metrics
}
func NewXgressEnv(closeNotify <-chan struct{}, registry metrics.Registry) xgress.Env {
return &xgEnv{
retransmitter: xgress.NewRetransmitter(dummyRetransmitterFaultReporter{}, registry, closeNotify),
payloadIngester: xgress.NewPayloadIngesterWithConfig(5, closeNotify),
metrics: xgress.NewMetrics(registry),
}
}
func (x xgEnv) GetRetransmitter() *xgress.Retransmitter {
return x.retransmitter
}
func (x xgEnv) GetPayloadIngester() *xgress.PayloadIngester {
return x.payloadIngester
}
func (x xgEnv) GetMetrics() xgress.Metrics {
return x.metrics
}
type dummyRetransmitterFaultReporter struct{}
func (d dummyRetransmitterFaultReporter) ReportForwardingFault(circuitId string, ctrlId string) {
// the only way to get a fault is if the connection goes down, in which case the circuit will
// get torn down anyway
}