env

package
v0.0.0-...-5cf3e1d Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	JetStreamBackend = "JetStream"
	EventMeshBackend = "EventMesh"
)
View Source
const JetStreamSubjectPrefix = "kyma"

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveBackend

type ActiveBackend string

type EventMeshConfig

type EventMeshConfig struct {
	Port                int           `envconfig:"INGRESS_PORT" default:"8080"`
	ClientID            string        `envconfig:"CLIENT_ID" required:"true"`
	ClientSecret        string        `envconfig:"CLIENT_SECRET" required:"true"`
	TokenEndpoint       string        `envconfig:"TOKEN_ENDPOINT" required:"true"`
	EventMeshPublishURL string        `envconfig:"EMS_PUBLISH_URL" required:"true"`
	MaxIdleConns        int           `envconfig:"MAX_IDLE_CONNS" default:"100"`
	MaxIdleConnsPerHost int           `envconfig:"MAX_IDLE_CONNS_PER_HOST" default:"2"`
	RequestTimeout      time.Duration `envconfig:"REQUEST_TIMEOUT" default:"5s"`
	// EventMeshNamespace is the name of the namespace in EventMesh which is used as the event source for legacy events.
	EventMeshNamespace string `envconfig:"BEB_NAMESPACE" required:"true"`
	// EventTypePrefix is the prefix of each event as per the eventing specification.
	// It follows the eventType format: <eventTypePrefix>.<appName>.<event-name>.<version>
	EventTypePrefix       string `envconfig:"EVENT_TYPE_PREFIX" default:""`
	ApplicationCRDEnabled bool   `envconfig:"APPLICATION_CRD_ENABLED" default:"true"`
}

EventMeshConfig represents the environment config for the Event Publisher to EventMesh.

func (*EventMeshConfig) ConfigureTransport

func (c *EventMeshConfig) ConfigureTransport(transport *http.Transport)

ConfigureTransport receives an HTTP transport and configure its max idle connection properties.

func (*EventMeshConfig) String

func (c *EventMeshConfig) String() string

String implements the fmt.Stringer interface.

type NATSConfig

type NATSConfig struct {
	Port                  int           `envconfig:"INGRESS_PORT" default:"8080"`
	URL                   string        `envconfig:"NATS_URL" required:"true"`
	RetryOnFailedConnect  bool          `envconfig:"RETRY_ON_FAILED_CONNECT" default:"true"`
	MaxReconnects         int           `envconfig:"MAX_RECONNECTS" default:"-1"` // Negative means keep try reconnecting.
	ReconnectWait         time.Duration `envconfig:"RECONNECT_WAIT" default:"5s"`
	RequestTimeout        time.Duration `envconfig:"REQUEST_TIMEOUT" default:"5s"`
	ApplicationCRDEnabled bool          `envconfig:"APPLICATION_CRD_ENABLED" default:"true"`

	// Legacy Namespace is used as the event source for legacy events
	LegacyNamespace string `envconfig:"LEGACY_NAMESPACE" default:"kyma"`
	// EventTypePrefix is the prefix of each event as per the eventing specification
	// It follows the eventType format: <eventTypePrefix>.<appName>.<event-name>.<version>
	EventTypePrefix string `envconfig:"EVENT_TYPE_PREFIX" default:"kyma"`

	// JetStream-specific configs
	JSStreamName string `envconfig:"JS_STREAM_NAME" default:"kyma"`
}

NATSConfig represents the environment config for the Event Publisher to NATS.

func (*NATSConfig) String

func (c *NATSConfig) String() string

String implements the fmt.Stringer interface.

func (*NATSConfig) ToConfig

func (c *NATSConfig) ToConfig() *EventMeshConfig

ToConfig converts to a default EventMeshConfig.

Jump to

Keyboard shortcuts

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