Documentation
¶
Index ¶
- func FormatRecord(r model.Record) string
- func MatchesFilter(rec model.Record, filter string) bool
- func PrintMap(w io.Writer, records []model.Record, svcMap docker.ServiceMap)
- func PrintTree(w io.Writer, records []model.Record, svcMap docker.ServiceMap, traceID string)
- func ResolveName(svcMap docker.ServiceMap, ip string) string
- func StreamWatch(ctx context.Context, r io.Reader, resolve ServiceResolver, filter string, ...) error
- type ServiceResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatRecord ¶
func ResolveName ¶
func ResolveName(svcMap docker.ServiceMap, ip string) string
func StreamWatch ¶
func StreamWatch( ctx context.Context, r io.Reader, resolve ServiceResolver, filter string, w io.Writer, ) error
StreamWatch reads NDJSON records from r and writes formatted output to w. It resolves IPs to service names using resolve and optionally filters by service name. It blocks until ctx is cancelled or r is exhausted.
If r implements io.Closer it will be closed when ctx is cancelled so that a blocking read is interrupted promptly.
Types ¶
type ServiceResolver ¶
type ServiceResolver func() docker.ServiceMap
ServiceResolver returns the current service map snapshot. It is called for each record so that updates are reflected in real time.
Click to show internal directories.
Click to hide internal directories.