config

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultComposeCommand = "docker compose"
	DefaultRuntimeCommand = "docker"
	DefaultTraefikPort    = 80
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Compose string `yaml:"compose"`
	Runtime string `yaml:"runtime"`
}

type Config

type Config struct {
	Command  Command                  `yaml:"command"`
	Traefik  Traefik                  `yaml:"traefik"`
	Services map[string]ServiceConfig `yaml:"services"`
}

func Load

func Load(projectDir, globalPath string) (Config, error)

Load reads config from .tug.yaml in projectDir (project-local) and globalPath (global), merging with project-local taking priority over global. Both files are optional; missing files are silently ignored.

func LoadDefault

func LoadDefault() (Config, error)

LoadDefault loads config using the current directory and the standard global config path (~/.config/tug.yaml).

type ServiceConfig

type ServiceConfig struct {
	Kind  string            `yaml:"kind"`  // default kind: "http" or "tcp"
	Ports map[uint16]string `yaml:"ports"` // per-port kind override: containerPort → "http" | "tcp"
}

ServiceConfig holds per-service overrides.

func (*ServiceConfig) UnmarshalYAML

func (s *ServiceConfig) UnmarshalYAML(unmarshal func(any) error) error

type Traefik added in v0.0.3

type Traefik struct {
	Port      uint16 `yaml:"port"`
	Dashboard bool   `yaml:"dashboard"`
}

Traefik holds configuration for the Traefik reverse proxy.

Jump to

Keyboard shortcuts

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