auto

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

README

CloudZero Scout Auto Package

The Auto Scout package provides automatic cloud environment detection by trying multiple cloud provider scouts until one successfully detects the environment.

Design

The auto package orchestrates multiple cloud provider scouts to provide automatic detection, rather than querying a specific cloud provider's metadata service directly.

Features

  • Concurrent Detection: Multiple scouts run concurrently for faster detection
  • Early Cancellation: Once a provider is detected, other scouts are cancelled
  • Error Isolation: Network errors in one scout don't prevent others from running
  • Caching: Results are cached to avoid repeated detection calls

Documentation

Overview

Package auto provides auto-detection capabilities for the CloudZero Scout.

The auto package orchestrates multiple cloud provider Scouts to provide automatic detection.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoCloudProviderDetected = errors.New("no cloud provider detected")

ErrNoCloudProviderDetected is returned when no cloud provider is detected

Functions

This section is empty.

Types

type Scout

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

Scout implements the types.Scout interface with auto-detection capabilities.

func NewScout

func NewScout(scouts ...types.Scout) *Scout

NewScout creates a new auto-detection Scout that tries the provided scouts.

Each scout is tried concurrently, but the first successful detection cancels the others to avoid unnecessary work.

func (*Scout) Detect

func (s *Scout) Detect(ctx context.Context) (types.CloudProvider, error)

Detect iterates through all provided scouts concurrently and returns the first cloud provider detected. Returns CloudProviderUnknown if no cloud provider is detected by any scout.

Network errors during detection are treated as "not detected" and do not prevent other scouts from running.

func (*Scout) EnvironmentInfo

func (s *Scout) EnvironmentInfo(ctx context.Context) (*types.EnvironmentInfo, error)

EnvironmentInfo attempts to retrieve environment information.

Jump to

Keyboard shortcuts

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