expected

package
v1.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UnknownPseudoNode1ID = render.MakePseudoNodeID(fixture.UnknownClient1IP)
	UnknownPseudoNode2ID = render.MakePseudoNodeID(fixture.UnknownClient3IP)

	RenderedEndpoints = report.Nodes{
		fixture.Client54001NodeID:    endpoint(fixture.Client54001NodeID, fixture.Server80NodeID),
		fixture.Client54002NodeID:    endpoint(fixture.Client54002NodeID, fixture.Server80NodeID),
		fixture.Server80NodeID:       endpoint(fixture.Server80NodeID),
		fixture.UnknownClient1NodeID: endpoint(fixture.UnknownClient1NodeID, fixture.Server80NodeID),
		fixture.UnknownClient2NodeID: endpoint(fixture.UnknownClient2NodeID, fixture.Server80NodeID),
		fixture.UnknownClient3NodeID: endpoint(fixture.UnknownClient3NodeID, fixture.Server80NodeID),
		fixture.RandomClientNodeID:   endpoint(fixture.RandomClientNodeID, fixture.Server80NodeID),
		fixture.NonContainerNodeID:   endpoint(fixture.NonContainerNodeID, fixture.GoogleEndpointNodeID),
		fixture.GoogleEndpointNodeID: endpoint(fixture.GoogleEndpointNodeID),
	}

	RenderedProcesses = report.Nodes{
		fixture.ClientProcess1NodeID: processNode(fixture.ClientProcess1NodeID, fixture.ServerProcessNodeID).
			WithLatests(map[string]string{
				report.HostNodeID: fixture.ClientHostNodeID,
				process.PID:       fixture.Client1PID,
				process.Name:      fixture.Client1Name,
			}).
			WithChildren(report.MakeNodeSet(
				RenderedEndpoints[fixture.Client54001NodeID],
			)),

		fixture.ClientProcess2NodeID: processNode(fixture.ClientProcess2NodeID, fixture.ServerProcessNodeID).
			WithChildren(report.MakeNodeSet(
				RenderedEndpoints[fixture.Client54002NodeID],
			)),

		fixture.ServerProcessNodeID: processNode(fixture.ServerProcessNodeID).
			WithChildren(report.MakeNodeSet(
				RenderedEndpoints[fixture.Server80NodeID],
			)),

		fixture.NonContainerProcessNodeID: processNode(fixture.NonContainerProcessNodeID, render.OutgoingInternetID).
			WithChildren(report.MakeNodeSet(
				RenderedEndpoints[fixture.NonContainerNodeID],
			)),

		render.IncomingInternetID: theIncomingInternetNode(fixture.ServerProcessNodeID),
		render.OutgoingInternetID: theOutgoingInternetNode,
	}

	RenderedProcessNames = report.Nodes{
		fixture.Client1Name: processNameNode(fixture.Client1Name, fixture.ServerName).
			WithLatests(map[string]string{process.Name: fixture.Client1Name}).
			WithCounters(map[string]int{report.Process: 2}).
			WithChildren(report.MakeNodeSet(
				RenderedEndpoints[fixture.Client54001NodeID],
				RenderedEndpoints[fixture.Client54002NodeID],
				RenderedProcesses[fixture.ClientProcess1NodeID],
				RenderedProcesses[fixture.ClientProcess2NodeID],
			)),

		fixture.ServerName: processNameNode(fixture.ServerName).
			WithLatests(map[string]string{process.Name: fixture.ServerName}).
			WithCounters(map[string]int{report.Process: 1}).
			WithChildren(report.MakeNodeSet(
				RenderedEndpoints[fixture.Server80NodeID],
				RenderedProcesses[fixture.ServerProcessNodeID],
			)),

		fixture.NonContainerName: processNameNode(fixture.NonContainerName, render.OutgoingInternetID).
			WithChildren(report.MakeNodeSet(
				RenderedEndpoints[fixture.NonContainerNodeID],
				RenderedProcesses[fixture.NonContainerProcessNodeID],
			)),

		render.IncomingInternetID: theIncomingInternetNode(fixture.ServerName),
		render.OutgoingInternetID: theOutgoingInternetNode,
	}

	RenderedContainers = report.Nodes{
		fixture.ClientContainerNodeID: container(fixture.ClientContainerNodeID, fixture.ServerContainerNodeID).
			WithLatests(map[string]string{
				report.HostNodeID:    fixture.ClientHostNodeID,
				docker.ContainerID:   fixture.ClientContainerID,
				docker.ContainerName: fixture.ClientContainerName,
				docker.ImageName:     fixture.ClientContainerImageName,
			}).
			WithChildren(report.MakeNodeSet(
				RenderedEndpoints[fixture.Client54001NodeID],
				RenderedEndpoints[fixture.Client54002NodeID],
				RenderedProcesses[fixture.ClientProcess1NodeID],
				RenderedProcesses[fixture.ClientProcess2NodeID],
			)),

		fixture.ServerContainerNodeID: container(fixture.ServerContainerNodeID).
			WithChildren(report.MakeNodeSet(
				RenderedEndpoints[fixture.Server80NodeID],
				RenderedProcesses[fixture.ServerProcessNodeID],
			)),

		render.IncomingInternetID: theIncomingInternetNode(fixture.ServerContainerNodeID),
		render.OutgoingInternetID: theOutgoingInternetNode,
		// contains filtered or unexported fields
	}

	RenderedContainerHostnames = report.Nodes{
		fixture.ClientContainerHostname: containerHostnameNode(fixture.ClientContainerHostname, fixture.ServerContainerHostname).
			WithLatests(map[string]string{
				docker.ContainerHostname: fixture.ClientContainerHostname,
			}).
			WithCounters(map[string]int{
				report.Container: 1,
			}).
			WithChildren(report.MakeNodeSet(
				RenderedEndpoints[fixture.Client54001NodeID],
				RenderedEndpoints[fixture.Client54002NodeID],
				RenderedProcesses[fixture.ClientProcess1NodeID],
				RenderedProcesses[fixture.ClientProcess2NodeID],
				RenderedContainers[fixture.ClientContainerNodeID],
			)),

		fixture.ServerContainerHostname: containerHostnameNode(fixture.ServerContainerHostname).
			WithLatests(map[string]string{
				docker.ContainerHostname: fixture.ServerContainerHostname,
			}).
			WithChildren(report.MakeNodeSet(
				RenderedEndpoints[fixture.Server80NodeID],
				RenderedProcesses[fixture.ServerProcessNodeID],
				RenderedContainers[fixture.ServerContainerNodeID],
			)),

		render.IncomingInternetID: theIncomingInternetNode(fixture.ServerContainerHostname),
		render.OutgoingInternetID: theOutgoingInternetNode,
		// contains filtered or unexported fields
	}

	ClientContainerImageNodeID = report.MakeContainerImageNodeID(fixture.ClientContainerImageName)
	ServerContainerImageNodeID = report.MakeContainerImageNodeID(fixture.ServerContainerImageName)

	RenderedContainerImages = report.Nodes{
		ClientContainerImageNodeID: containerImage(ClientContainerImageNodeID, ServerContainerImageNodeID).
			WithLatests(map[string]string{
				report.HostNodeID: fixture.ClientHostNodeID,
				docker.ImageID:    fixture.ClientContainerImageID,
				docker.ImageName:  fixture.ClientContainerImageName,
			}).
			WithCounters(map[string]int{
				report.Container: 1,
			}).
			WithChildren(report.MakeNodeSet(
				RenderedEndpoints[fixture.Client54001NodeID],
				RenderedEndpoints[fixture.Client54002NodeID],
				RenderedProcesses[fixture.ClientProcess1NodeID],
				RenderedProcesses[fixture.ClientProcess2NodeID],
				RenderedContainers[fixture.ClientContainerNodeID],
			)),

		ServerContainerImageNodeID: containerImage(ServerContainerImageNodeID).
			WithChildren(report.MakeNodeSet(
				RenderedEndpoints[fixture.Server80NodeID],
				RenderedProcesses[fixture.ServerProcessNodeID],
				RenderedContainers[fixture.ServerContainerNodeID],
			)),

		render.IncomingInternetID: theIncomingInternetNode(ServerContainerImageNodeID),
		render.OutgoingInternetID: theOutgoingInternetNode,
		// contains filtered or unexported fields
	}

	UnmanagedServerID = render.MakePseudoNodeID(render.UnmanagedID, fixture.ServerHostID)

	RenderedPods = report.Nodes{
		fixture.ClientPodNodeID: pod(fixture.ClientPodNodeID, fixture.ServerPodNodeID).
			WithChildren(report.MakeNodeSet(
				RenderedEndpoints[fixture.Client54001NodeID],
				RenderedEndpoints[fixture.Client54002NodeID],
				RenderedProcesses[fixture.ClientProcess1NodeID],
				RenderedProcesses[fixture.ClientProcess2NodeID],
				RenderedContainers[fixture.ClientContainerNodeID],
			)),

		fixture.ServerPodNodeID: pod(fixture.ServerPodNodeID).
			WithChildren(report.MakeNodeSet(
				RenderedEndpoints[fixture.Server80NodeID],
				RenderedProcesses[fixture.ServerProcessNodeID],
				RenderedContainers[fixture.ServerContainerNodeID],
			)),

		UnmanagedServerID:         unmanagedServerNode,
		render.IncomingInternetID: theIncomingInternetNode(fixture.ServerPodNodeID),
		render.OutgoingInternetID: theOutgoingInternetNode,
	}

	RenderedPodServices = report.Nodes{
		fixture.ServiceNodeID: service(fixture.ServiceNodeID, fixture.ServiceNodeID).
			WithChildren(report.MakeNodeSet(
				RenderedEndpoints[fixture.Client54001NodeID],
				RenderedEndpoints[fixture.Client54002NodeID],
				RenderedEndpoints[fixture.Server80NodeID],
				RenderedProcesses[fixture.ClientProcess1NodeID],
				RenderedProcesses[fixture.ClientProcess2NodeID],
				RenderedProcesses[fixture.ServerProcessNodeID],
				RenderedContainers[fixture.ClientContainerNodeID],
				RenderedContainers[fixture.ServerContainerNodeID],
				RenderedPods[fixture.ClientPodNodeID],
				RenderedPods[fixture.ServerPodNodeID],
			)),

		UnmanagedServerID:         unmanagedServerNode,
		render.IncomingInternetID: theIncomingInternetNode(fixture.ServiceNodeID),
		render.OutgoingInternetID: theOutgoingInternetNode,
	}

	RenderedHosts = report.Nodes{
		fixture.ClientHostNodeID: hostNode(fixture.ClientHostNodeID, fixture.ServerHostNodeID).
			WithLatests(map[string]string{
				host.HostName: fixture.ClientHostName,
			}).
			WithChildren(report.MakeNodeSet(
				RenderedEndpoints[fixture.Client54001NodeID],
				RenderedEndpoints[fixture.Client54002NodeID],
				RenderedProcesses[fixture.ClientProcess1NodeID],
				RenderedProcesses[fixture.ClientProcess2NodeID],
				RenderedContainers[fixture.ClientContainerNodeID],
				RenderedContainerImages[ClientContainerImageNodeID],
				RenderedPods[fixture.ClientPodNodeID],
			)),

		fixture.ServerHostNodeID: hostNode(fixture.ServerHostNodeID, render.OutgoingInternetID).
			WithChildren(report.MakeNodeSet(
				RenderedEndpoints[fixture.Server80NodeID],
				RenderedEndpoints[fixture.NonContainerNodeID],
				RenderedProcesses[fixture.ServerProcessNodeID],
				RenderedProcesses[fixture.NonContainerProcessNodeID],
				RenderedContainers[fixture.ServerContainerNodeID],
				RenderedContainerImages[ServerContainerImageNodeID],
				RenderedPods[fixture.ServerPodNodeID],
			)),

		render.IncomingInternetID: theIncomingInternetNode(fixture.ServerHostNodeID),
		render.OutgoingInternetID: theOutgoingInternetNode,
	}
)

Exported for testing.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL