cloudfoundry

package
v0.0.0-...-45a9bcf Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ContainerNameTagKey tag key for container tags
	ContainerNameTagKey = "container_name"
	// AppInstanceGUIDTagKey tag key for container tags
	AppInstanceGUIDTagKey = "app_instance_guid"
	// AppNameTagKey tag key for container tags
	AppNameTagKey = "app_name"
	// AppInstanceIndexTagKey tag key for container tags
	AppInstanceIndexTagKey = "app_instance_index"
	// AppGUIDTagKey tag key for container tags
	AppGUIDTagKey = "app_guid"
	// AppIDTagKey tag key for container tags. We carry both app_guid and app_id; this is because
	// we added app_guid initially here, but then we added space_id and org_id that have just "_id"
	// to be consistent with https://github.com/DataDog/datadog-firehose-nozzle; therefore we now
	// also include "app_id" to have a consistent set of tags that end with "_id".
	AppIDTagKey = "app_id"
	// OrgIDTagKey tag key for container tags
	// NOTE: we use "org_*" instead of "organization_* to have the tags consistent with
	// tags attached by https://github.com/DataDog/datadog-firehose-nozzle
	OrgIDTagKey = "org_id"
	// OrgNameTagKey tag key for container tags
	OrgNameTagKey = "org_name"
	// SpaceIDTagKey tag key for container tags
	SpaceIDTagKey = "space_id"
	// SpaceNameTagKey tag key for container tags
	SpaceNameTagKey = "space_name"
	// SidecarPresentTagKey tag key for container tags
	SidecarPresentTagKey = "sidecar_present"
	// SidecarCountTagKey tag key for container tags
	SidecarCountTagKey = "sidecar_count"
	// SegmentNameTagKey tag key for container tags
	SegmentNameTagKey = "segment_name"
	// SegmentIDTagKey tag key for container tags
	SegmentIDTagKey = "segment_id"
)

Variables

View Source
var (
	// CloudProviderName is the name for this cloudprovider
	CloudProviderName = "CloudFoundry"
)

Functions

func ContainersToHandles

func ContainersToHandles(containers []garden.Container) []string

ContainersToHandles returns a list of handles from a list of garden.Container

func GetHostAliases

func GetHostAliases(_ context.Context) ([]string, error)

GetHostAliases returns the host aliases from Cloud Foundry

Types

type GardenUtil

type GardenUtil struct {
	// contains filtered or unexported fields
}

GardenUtil wraps interactions with a local garden API.

func GetGardenUtil

func GetGardenUtil() (*GardenUtil, error)

GetGardenUtil returns the global instance of the garden utility and initializes it first if needed

func (*GardenUtil) GetContainer

func (gu *GardenUtil) GetContainer(handle string) (garden.Container, error)

GetContainer returns a container with the given handle from the local garden API

func (*GardenUtil) GetContainersInfo

func (gu *GardenUtil) GetContainersInfo(handles []string) (map[string]garden.ContainerInfoEntry, error)

GetContainersInfo returns ContainerInfo per handle

func (*GardenUtil) GetContainersMetrics

func (gu *GardenUtil) GetContainersMetrics(handles []string) (map[string]garden.ContainerMetricsEntry, error)

GetContainersMetrics returns ContainerMetrics per handle

func (*GardenUtil) ListContainers

func (gu *GardenUtil) ListContainers() ([]garden.Container, error)

ListContainers returns the list of running containers from the local garden API

type GardenUtilInterface

type GardenUtilInterface interface {
	ListContainers() ([]garden.Container, error)
	GetContainersInfo(handles []string) (map[string]garden.ContainerInfoEntry, error)
	GetContainersMetrics(handles []string) (map[string]garden.ContainerMetricsEntry, error)
	GetContainer(string) (garden.Container, error)
}

GardenUtilInterface describes a wrapper for collecting local garden containers

Jump to

Keyboard shortcuts

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