MCPcopy Index your code
hub / github.com/deepflowio/deepflow / formatString

Function formatString

cli/ctl/ingester_check.go:267–285  ·  view source on GitHub ↗
(data *trident.Interface)

Source from the content-addressed store, hash-verified

265}
266
267func formatString(data *trident.Interface) string {
268 buffer := bytes.Buffer{}
269 format := "Id: %d Mac: %s EpcId: %d DeviceType: %d DeviceId: %d IfType: %d" +
270 " LaunchServer: %s LaunchServerId: %d RegionId: %d AzId: %d, PodGroupId: %d, " +
271 "PodNsId: %d, PodId: %d, PodClusterId: %d, PodGroupType: %d, NetnsId: %d, AgentId: %d, IsVipInterface: %t "
272 buffer.WriteString(fmt.Sprintf(format, data.GetId(), Uint64ToMac(data.GetMac()),
273 data.GetEpcId(), data.GetDeviceType(), data.GetDeviceId(), data.GetIfType(),
274 data.GetLaunchServer(), data.GetLaunchServerId(), data.GetRegionId(),
275 data.GetAzId(), data.GetPodGroupId(), data.GetPodNsId(), data.GetPodId(),
276 data.GetPodClusterId(), data.GetPodGroupType(), data.GetNetnsId(),
277 data.GetVtapId(), data.GetIsVipInterface()))
278 if data.GetPodNodeId() > 0 {
279 buffer.WriteString(fmt.Sprintf("PodNodeId: %d ", data.GetPodNodeId()))
280 }
281 if len(data.GetIpResources()) > 0 {
282 buffer.WriteString(fmt.Sprintf("IpResources: %s", data.GetIpResources()))
283 }
284 return buffer.String()
285}
286
287func platformData(response *trident.SyncResponse) {
288 platform := trident.PlatformData{}

Callers 1

platformDataFunction · 0.85

Calls 4

WriteStringMethod · 0.80
GetLaunchServerMethod · 0.80
Uint64ToMacFunction · 0.70
StringMethod · 0.65

Tested by

no test coverage detected