k8s

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package k8s provides Kubernetes environment detection and integration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Detector

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

Detector detects the runtime environment and adapts service configuration.

func NewDetector

func NewDetector() *Detector

NewDetector creates a new environment detector.

func (*Detector) AdaptServiceConfig

func (d *Detector) AdaptServiceConfig(config *registry.ServiceConfig) *registry.ServiceConfig

AdaptServiceConfig adapts service configuration based on environment.

func (*Detector) DiscoverServices

func (d *Detector) DiscoverServices(ctx context.Context, serviceType registry.ServiceType) ([]*registry.ServiceConfig, error)

DiscoverServices discovers services from Kubernetes API.

func (*Detector) Environment

func (d *Detector) Environment() EnvironmentType

Environment returns the detected environment type.

func (*Detector) IsKubernetes

func (d *Detector) IsKubernetes() bool

IsKubernetes returns true if running in any Kubernetes environment.

func (*Detector) WatchServices

func (d *Detector) WatchServices(ctx context.Context, callback func(*registry.ServiceConfig, string)) error

WatchServices watches for service changes in Kubernetes.

type EnvironmentType

type EnvironmentType string

EnvironmentType represents the deployment environment.

const (
	EnvLocal      EnvironmentType = "local"
	EnvDocker     EnvironmentType = "docker"
	EnvKubernetes EnvironmentType = "kubernetes"
	EnvKnative    EnvironmentType = "knative"
	EnvOpenShift  EnvironmentType = "openshift"
)

Jump to

Keyboard shortcuts

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