Files
barkfile-parser/schema.go
Shaun Campbell f7af38f9ea
All checks were successful
Test and Release Module / test (push) Successful in 20s
Test and Release Module / release (push) Successful in 11s
feat: add treatvault block and TreatVault label constants
2026-09-16 15:47:46 -04:00

49 lines
1.4 KiB
Go

// Package barkfile parses, validates, and watches Barkfile configuration.
package barkfile
import "time"
// Config is the typed representation of a Barkfile.
type Config struct {
Listen string
TLS TLSConfig
Databases []DatabaseConfig
TreatVault *TreatVaultConfig
}
// TreatVaultConfig identifies the encrypted secret source of truth and the
// bootstrap Docker secret containing its age X25519 identity.
type TreatVaultConfig struct {
File string
IdentitySecret string
}
// TLSConfig identifies the certificate material used to terminate client TLS.
type TLSConfig struct {
CertFile string
KeyFile string
}
// DatabaseConfig describes one PostgreSQL database. Hostname is optional:
// clients without TLS SNI route by the database's configured Name. Exactly one
// of Upstream and Postgres must be configured.
type DatabaseConfig struct {
Name string
Hostname string
Upstream string
Postgres *PostgresConfig
}
// PostgresConfig declares a PawSQL-managed PostgreSQL container. PasswordSecret
// is a short Barkfile reference resolved to a Docker secret named
// barkstack_<reference>. IdleTimeout starts after the last proxied client
// session closes. TrafficIdleTimeout applies to open sessions with no proxied
// bytes. Zero disables either timeout.
type PostgresConfig struct {
Image string
Volume string
PasswordSecret string
IdleTimeout time.Duration
TrafficIdleTimeout time.Duration
}