config

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	AttachModeNative  = "native"
	AttachModeGeneric = "generic"
)
View Source
const (
	LoggingSystemOutputStdout = "stdout"
	LoggingSystemOutputFile   = "file"
)
View Source
const (
	UpfNodeID = "0.0.0.0"
)

Variables

View Source
var CheckInterfaceExistsFunc = func(name string) (bool, error) {
	networkInterface, err := net.InterfaceByName(name)
	if err != nil {
		return false, err
	}
	if networkInterface == nil {
		return false, nil
	}
	return true, nil
}
View Source
var GetInterfaceIPFunc = func(name string) (string, error) {
	iface, err := net.InterfaceByName(name)
	if err != nil {
		return "", err
	}

	addresses, err := iface.Addrs()
	if err != nil {
		return "", err
	}

	for _, addr := range addresses {
		if ip, _, err := net.ParseCIDR(addr.String()); err == nil {
			if ip.To4() != nil {
				return ip.String(), nil
			}
		}
	}

	return "", errors.New("no valid IPv4 address found")
}

Functions

func GetInterfaceIP added in v0.0.7

func GetInterfaceIP(name string) (string, error)

func InterfaceExists added in v0.0.7

func InterfaceExists(name string) (bool, error)

Types

type API

type API struct {
	Port int
	TLS  TLS
}

type APIInterface

type APIInterface struct {
	Name string
	Port int
	TLS  TLS
}

type APIInterfaceYaml

type APIInterfaceYaml struct {
	Name string `yaml:"name"`
	Port int    `yaml:"port"`
	TLS  TLSYaml
}

type APIYaml

type APIYaml struct {
	Port int     `yaml:"port"`
	TLS  TLSYaml `yaml:"tls"`
}

type AuditLogging added in v0.0.8

type AuditLogging struct {
	Output string
	Path   string
}

type AuditLoggingYaml added in v0.0.8

type AuditLoggingYaml struct {
	Output string `yaml:"output"`
	Path   string `yaml:"path"`
}

type Config

type Config struct {
	Logging    Logging
	DB         DB
	Interfaces Interfaces
	XDP        XDP
	Telemetry  Telemetry
}

func Validate

func Validate(filePath string) (Config, error)

type ConfigYAML

type ConfigYAML struct {
	Logging    LoggingYaml    `yaml:"logging"`
	DB         DBYaml         `yaml:"db"`
	Interfaces InterfacesYaml `yaml:"interfaces"`
	XDP        XDPYaml        `yaml:"xdp"`
	Telemetry  TelemetryYaml  `yaml:"telemetry"`
}

type DB

type DB struct {
	Path string
}

type DBYaml

type DBYaml struct {
	Path string `yaml:"path"`
}

type Interfaces

type Interfaces struct {
	N2  N2Interface
	N3  N3Interface
	N6  N6Interface
	API APIInterface
}

type InterfacesYaml

type InterfacesYaml struct {
	N2  N2InterfaceYaml  `yaml:"n2"`
	N3  N3InterfaceYaml  `yaml:"n3"`
	N6  N6InterfaceYaml  `yaml:"n6"`
	API APIInterfaceYaml `yaml:"api"`
}

type Logging added in v0.0.8

type Logging struct {
	SystemLogging SystemLogging
	AuditLogging  AuditLogging
}

type LoggingYaml added in v0.0.8

type LoggingYaml struct {
	SystemLogging SystemLoggingYaml `yaml:"system"`
	AuditLogging  AuditLoggingYaml  `yaml:"audit"`
}

type N2Interface added in v0.0.5

type N2Interface struct {
	Name    string
	Address string
	Port    int
}

type N2InterfaceYaml added in v0.0.5

type N2InterfaceYaml struct {
	Name string `yaml:"name"`
	Port int    `yaml:"port"`
}

type N3Interface

type N3Interface struct {
	Name    string
	Address string
}

type N3InterfaceYaml

type N3InterfaceYaml struct {
	Name string `yaml:"name"`
}

type N6Interface

type N6Interface struct {
	Name string
}

type N6InterfaceYaml

type N6InterfaceYaml struct {
	Name string `yaml:"name"`
}

type SystemLogging added in v0.0.8

type SystemLogging struct {
	Level  string
	Output string
	Path   string
}

type SystemLoggingYaml added in v0.0.8

type SystemLoggingYaml struct {
	Level  string `yaml:"level"`
	Output string `yaml:"output"`
	Path   string `yaml:"path"`
}

type TLS

type TLS struct {
	Cert string
	Key  string
}

type TLSYaml

type TLSYaml struct {
	Cert string `yaml:"cert"`
	Key  string `yaml:"key"`
}

type Telemetry added in v0.0.18

type Telemetry struct {
	Enabled      bool
	OTLPEndpoint string // e.g., "otel-collector.default.svc:4317"
}

type TelemetryYaml added in v0.0.18

type TelemetryYaml struct {
	Enabled      bool   `yaml:"enabled"`
	OTLPEndpoint string `yaml:"otlp-endpoint"`
}

type UPFYaml

type UPFYaml struct {
	Interfaces []string `yaml:"interfaces"`
}

type XDP added in v0.0.6

type XDP struct {
	AttachMode string
}

type XDPYaml added in v0.0.6

type XDPYaml struct {
	AttachMode string `yaml:"attach-mode"`
}

Jump to

Keyboard shortcuts

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