util

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IptablesLogPrefix = "IPTABLES_LOG_PREFIX"
	IptablesLogPath   = "IPTABLES_LOG_PATH"
)

required env vars

View Source
const (
	KubeApiServer = "KUBE_API_SERVER" // default value is empty string

	KubeEventDisplayReason        = "KUBE_EVENT_DISPLAY_REASON"
	DefaultKubeEventDisplayReason = "PacketDrop"

	KubeEventSourceComponentName        = "KUBE_EVENT_SOURCE_COMPONENT_NAME"
	DefaultKubeEventSourceComponentName = "kube-iptables-tailer"

	MetricsServerPort        = "METRICS_SERVER_PORT"
	DefaultMetricsServerPort = 9090

	PacketDropChannelBufferSize         = "PACKET_DROP_CHANNEL_BUFFER_SIZE"
	DefaultPacketDropsChannelBufferSize = 100

	PacketDropExpirationMinutes        = "PACKET_DROP_EXPIRATION_MINUTES"
	DefaultPacketDropExpirationMinutes = 10

	RepeatedEventIntervalMinutes        = "REPEATED_EVENTS_INTERVAL_MINUTES"
	DefaultRepeatedEventIntervalMinutes = 2

	WatchLogsIntervalSeconds       = "WATCH_LOGS_INTERVAL_SECONDS"
	DefaultWatchLogsIntervalSecond = 5
)

optional env vars

Variables

This section is empty.

Functions

func GetEnvIntOrDefault

func GetEnvIntOrDefault(key string, def int) int

func GetEnvStringOrDefault

func GetEnvStringOrDefault(key string, def string) string

func GetExpiredTimeInString

func GetExpiredTimeInString(expirationMinutes int, timeFormat string) string

Utility functions for packet drop testing

func GetRequiredEnvInt

func GetRequiredEnvInt(key string) int

func GetRequiredEnvString

func GetRequiredEnvString(key string) string

func PrettyPrint

func PrettyPrint(i interface{}) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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