Documentation
¶
Overview ¶
Package k8s provides Kubernetes environment detection and integration.
Index ¶
- type Detector
- func (d *Detector) AdaptServiceConfig(config *registry.ServiceConfig) *registry.ServiceConfig
- func (d *Detector) DiscoverServices(ctx context.Context, serviceType registry.ServiceType) ([]*registry.ServiceConfig, error)
- func (d *Detector) Environment() EnvironmentType
- func (d *Detector) IsKubernetes() bool
- func (d *Detector) WatchServices(ctx context.Context, callback func(*registry.ServiceConfig, string)) error
- type EnvironmentType
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 (*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 ¶
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" )
Click to show internal directories.
Click to hide internal directories.