config

package
v0.0.0-...-9bb27b8 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package config provides configuration schema, loading, and embedding for kubesnake.

kubesnake is designed to remain a single portable binary that can carry its configuration as it propagates through a cluster. This package defines the config schema and provides helpers for loading/embedding config into the current executable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmbedConfigDataIntoExecutable

func EmbedConfigDataIntoExecutable(exePath string, config []byte) error

EmbedConfigDataIntoExecutable embeds config bytes into the given executable path. The executable is rewritten to a temporary file in the same directory and atomically renamed into place.

func EmbedConfigFileIntoExecutable

func EmbedConfigFileIntoExecutable(exePath, cfgPath string) error

EmbedConfigFileIntoExecutable reads cfgPath, validates it as JSON, and embeds the config data into exePath.

func EmbedConfigFileIntoSelf

func EmbedConfigFileIntoSelf(cfgPath string) (string, error)

EmbedConfigFileIntoSelf embeds the JSON config at cfgPath into the current executable, returning the resolved executable path.

Types

type Config

type Config struct {
	E2E *E2EConfig `json:"e2e"`
}

Config is the top-level configuration schema. Keep this minimal and additive (backwards compatible) over time.

func LoadConfigFromFile

func LoadConfigFromFile(cfgPath string) (*Config, error)

LoadConfigFromFile reads and parses a JSON config file.

func LoadEmbeddedConfigFromExecutable

func LoadEmbeddedConfigFromExecutable(exePath string) (*Config, error)

LoadEmbeddedConfigFromExecutable loads and parses an embedded config from a specific executable path. If no embedded config exists, it returns (nil, nil).

func LoadEmbeddedConfigFromSelf

func LoadEmbeddedConfigFromSelf() (*Config, error)

LoadEmbeddedConfigFromSelf loads the embedded config from the current executable. If no embedded config exists, it returns (nil, nil).

func (*Config) E2EBeaconURL

func (c *Config) E2EBeaconURL() string

E2EBeaconURL returns the configured e2e beacon URL, if present.

type E2EConfig

type E2EConfig struct {
	BeaconURL string `json:"beaconUrl"`
}

Jump to

Keyboard shortcuts

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