env

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Knative-Kafka Configuration
	ServiceAccountEnvVarKey = "SERVICE_ACCOUNT"
	MetricsPortEnvVarKey    = "METRICS_PORT"
	HealthPortEnvVarKey     = "HEALTH_PORT"

	// Kafka Authorization
	KafkaBrokerEnvVarKey   = "KAFKA_BROKERS"
	KafkaUsernameEnvVarKey = "KAFKA_USERNAME"
	KafkaPasswordEnvVarKey = "KAFKA_PASSWORD"

	// Kafka Configuration
	KafkaProviderEnvVarKey                   = "KAFKA_PROVIDER"
	KafkaOffsetCommitMessageCountEnvVarKey   = "KAFKA_OFFSET_COMMIT_MESSAGE_COUNT"
	KafkaOffsetCommitDurationMillisEnvVarKey = "KAFKA_OFFSET_COMMIT_DURATION_MILLIS"
	KafkaTopicEnvVarKey                      = "KAFKA_TOPIC"

	// Dispatcher Configuration
	ChannelKeyEnvVarKey           = "CHANNEL_KEY"
	ExponentialBackoffEnvVarKey   = "EXPONENTIAL_BACKOFF"
	InitialRetryIntervalEnvVarKey = "INITIAL_RETRY_INTERVAL"
	MaxRetryTimeEnvVarKey         = "MAX_RETRY_TIME"

	// Default Values To Use If Not Available In Env Variables
	DefaultKafkaOffsetCommitMessageCount   = "100"
	DefaultKafkaOffsetCommitDurationMillis = "5000"

	// Default Values To Use If Not Available In Knative Channels Argument
	DefaultNumPartitionsEnvVarKey     = "DEFAULT_NUM_PARTITIONS"
	DefaultReplicationFactorEnvVarKey = "DEFAULT_REPLICATION_FACTOR"
	DefaultRetentionMillisEnvVarKey   = "DEFAULT_RETENTION_MILLIS"

	// Dispatcher Event Retry Values
	DispatcherRetryInitialIntervalMillisEnvVarKey = "DISPATCHER_RETRY_INITIAL_INTERVAL_MILLIS"
	DispatcherRetryTimeMillisMaxEnvVarKey         = "DISPATCHER_RETRY_TIME_MILLIS"
	DispatcherRetryExponentialBackoffEnvVarKey    = "DISPATCHER_RETRY_EXPONENTIAL_BACKOFF"

	// Default Values If Optional Environment Variable Defaults Not Specified
	DefaultRetentionMillis                 = "604800000" // 1 Week
	DefaultEventRetryInitialIntervalMillis = "500"       // 0.5 seconds
	DefaultEventRetryTimeMillisMax         = "300000"    // 5 minutes
	DefaultExponentialBackoff              = "true"      // Enabled

	// Kafka Provider Types
	KafkaProviderValueLocal     = "local"
	KafkaProviderValueConfluent = "confluent"
	KafkaProviderValueAzure     = "azure"

	// Dispatcher Resources
	DispatcherImageEnvVarKey         = "DISPATCHER_IMAGE"
	DispatcherReplicasEnvVarKey      = "DISPATCHER_REPLICAS"
	DispatcherCpuRequestEnvVarKey    = "DISPATCHER_CPU_REQUEST"
	DispatcherCpuLimitEnvVarKey      = "DISPATCHER_CPU_LIMIT"
	DispatcherMemoryRequestEnvVarKey = "DISPATCHER_MEMORY_REQUEST"
	DispatcherMemoryLimitEnvVarKey   = "DISPATCHER_MEMORY_LIMIT"

	// Channel Resources
	ChannelImageEnvVarKey         = "CHANNEL_IMAGE"
	ChannelReplicasEnvVarKey      = "CHANNEL_REPLICAS"
	ChannelMemoryRequestEnvVarKey = "CHANNEL_MEMORY_REQUEST"
	ChannelMemoryLimitEnvVarKey   = "CHANNEL_MEMORY_LIMIT"
	ChannelCpuRequestEnvVarKey    = "CHANNEL_CPU_REQUEST"
	ChannelCpuLimitEnvVarKey      = "CHANNEL_CPU_LIMIT"
)

Package Constants

Variables

This section is empty.

Functions

This section is empty.

Types

type Environment

type Environment struct {

	// Knative-Kafka Configuration
	ServiceAccount string // Required
	MetricsPort    int    // Required

	// Kafka Configuration / Authorization
	KafkaProvider                   string // Required
	KafkaOffsetCommitMessageCount   int64  // Optional
	KafkaOffsetCommitDurationMillis int64  // Optional

	// Default Values To Use If Not Available In Knative Channels Argument
	DefaultNumPartitions     int   // Required
	DefaultReplicationFactor int   // Required
	DefaultRetentionMillis   int64 // Optional

	// Resource configuration
	DispatcherImage         string            // Required
	DispatcherReplicas      int               // Required
	DispatcherMemoryRequest resource.Quantity // Required
	DispatcherMemoryLimit   resource.Quantity // Required
	DispatcherCpuRequest    resource.Quantity // Required
	DispatcherCpuLimit      resource.Quantity // Required

	// Dispatcher Retry Settings
	DispatcherRetryInitialIntervalMillis int64 // Optional
	DispatcherRetryTimeMillisMax         int64 // Optional
	DispatcherRetryExponentialBackoff    bool  // Optional

	// Resource Limits for each Channel Deployment
	ChannelImage         string            // Required
	ChannelReplicas      int               // Required
	ChannelMemoryRequest resource.Quantity // Required
	ChannelMemoryLimit   resource.Quantity // Required
	ChannelCpuRequest    resource.Quantity // Required
	ChannelCpuLimit      resource.Quantity // Required
}

Environment Structure

func GetEnvironment

func GetEnvironment(logger *zap.Logger) (*Environment, error)

Get The Environment

Jump to

Keyboard shortcuts

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