config

package
v0.2.27 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Edge Mode (active connection to Dockhand)
	DockhandServerURL string // e.g., wss://dockhand.example.com/api/hawser/connect
	Token             string // Agent authentication token
	CACert            string // Optional CA certificate path (for self-signed Dockhand)
	TLSSkipVerify     bool   // Skip TLS verification (insecure, for testing)

	// Standard Mode (passive HTTP server)
	Port    int    // Default: 2376
	TLSCert string // Optional TLS certificate path
	TLSKey  string // Optional TLS key path

	// Docker connection
	DockerSocket string // Default: /var/run/docker.sock
	DockerHost   string // Alternative: tcp://localhost:2375

	// Agent identification
	AgentID   string // Auto-generated UUID if not set
	AgentName string // Human-readable name

	// Timeouts and intervals (seconds)
	HeartbeatInterval int // Default: 30
	RequestTimeout    int // Default: 30
	ReconnectDelay    int // Initial reconnect delay, default: 1
	MaxReconnectDelay int // Max reconnect delay, default: 60

	// Logging
	LogLevel string // debug, info, warn, error. Default: info

	// Stack files directory
	StacksDir string // Directory for stack files, default: /data/stacks

	// Version info (set by main.go from ldflags)
	Version string
	Commit  string
}

Config holds all configuration for the Hawser agent

func Load

func Load() (*Config, error)

Load reads configuration from environment variables and flags

func (*Config) EdgeMode

func (c *Config) EdgeMode() bool

EdgeMode returns true if the agent should run in edge mode

func (*Config) GetDockerEndpoint

func (c *Config) GetDockerEndpoint() string

GetDockerEndpoint returns the Docker endpoint to connect to

func (*Config) TLSEnabled

func (c *Config) TLSEnabled() bool

TLSEnabled returns true if TLS is configured for standard mode

Jump to

Keyboard shortcuts

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