Documentation ¶
Overview ¶
Package v1 implements the Ghostwire v1 REST API discovery JSON results.
Index ¶
Constants ¶
const CreatorID = "gostwire"
CreatorID specifies the metadata creator ID.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiscoveryResult ¶
type DiscoveryResult struct { Metadata Metadata `json:"metadata"` NetworkNamespaces networkNamespaces `json:"network-namespaces"` PIDNamespaces pidNamespaces `json:"pid-namespaces"` }
DiscoveryResult represents a Ghostwire v1 discovery result, consisting of some metadata, the discovered network namespaces and PID namespaces.
func NewDiscoveryResult ¶
func NewDiscoveryResult(result gostwire.DiscoveryResult) DiscoveryResult
NewDiscoveryResult returns a JSON marshallable DiscoveryResult for the given gostwire.DiscoveryResult.
type Metadata ¶
type Metadata map[string]interface{}
Metadata holds meta information about a discovery, such as the creator used ("Dr. Livingstone, I presume") and when the discovery was done.
func NewMetadata ¶
func NewMetadata(result gostwire.DiscoveryResult) Metadata
NewMetadata returns new and properly filled-in discovery meta data. It invokes the registered metadata plugins to augment the baseline metadata with additional tidbits of information.
type NetworkNamespaceJSON ¶
type NetworkNamespaceJSON struct { ContainerGroups []*containerGroup `json:"container-groups"` Containers []container `json:"containers"` ID string `json:"id"` NetnsID uint64 `json:"netnsid"` NetworkInterfaces []networkInterface `json:"network-interfaces"` Routes ipvxRoutes `json:"routes"` TransportPorts ipvxPorts `json:"transport-ports"` ForwardedPorts ipvxForwardedPorts `json:"forwarded-ports"` }
NetworkNamespaceJSON describes discovery details for a single network namespace, marshallable into JSON.
type TargetDiscoveryResult ¶
type TargetDiscoveryResult struct { Metadata Metadata `json:"metadata"` Containers captureTargets `json:"containers"` }
TargetDiscoveryResult contains information about the capture targets for JSON marshalling.
func NewTargetDiscoveryResult ¶
func NewTargetDiscoveryResult(result gostwire.DiscoveryResult) TargetDiscoveryResult
NewTargetDiscoveryResult returns a new TargetDiscoveryResult for the specified network namespace discovery results, to be marshalled into JSON.