Artifact 3dfd9c735b31d2e4e39051b9651431010eba7769b2159fab8ef12093fdb77e8e:
- File
bridge/bridge/config.go
— part of check-in
[eda7960b81]
at
2026-04-23 19:23:42
on branch trunk
— rename module to github.com/danmestas/EdgeSync
Fix the case-sensitive module path to match the actual GitHub repo URL (danmestas/EdgeSync). Remove tracked leaf/leaf binary and ignore .claude/skills/ scratchpad dirs. (user: [email protected], size: 1040) [annotate] [blame] [check-ins using] [more...]
package bridge import ( "fmt" libfossil "github.com/danmestas/libfossil" ) // Config holds the settings for a Bridge instance. type Config struct { NATSUrl string // default "nats://localhost:4222" FossilURL string // required (unless Upstream is set) ProjectCode string // required SubjectPrefix string // default "fossil" // Upstream is the transport to the Fossil server. Nil defaults to // HTTPTransport using FossilURL. Set for simulation or testing. Upstream libfossil.Transport // Buggify is an optional fault injection checker. Nil in production. Buggify libfossil.BuggifyChecker } func (c *Config) applyDefaults() { if c.NATSUrl == "" { c.NATSUrl = "nats://localhost:4222" } if c.SubjectPrefix == "" { c.SubjectPrefix = "fossil" } } func (c *Config) validate() error { if c.FossilURL == "" && c.Upstream == nil { return fmt.Errorf("bridge: FossilURL is required (unless Upstream is set)") } if c.ProjectCode == "" { return fmt.Errorf("bridge: ProjectCode is required") } return nil }