hub/internal/domain/config.go

27 lines
459 B
Go
Raw Normal View History

2023-03-12 07:33:08 +00:00
package domain
import (
"net/url"
"testing"
)
type Config struct {
BaseURL *url.URL `env:"BASE_URL" envDefault:"http://localhost:3000/"`
2023-03-15 00:20:52 +00:00
Bind string `end:"BIND,required" envDefault:":3000"`
2023-03-12 07:33:08 +00:00
Name string `env:"NAME" envDefault:"WebSub"`
}
func TestConfig(tb testing.TB) *Config {
tb.Helper()
return &Config{
BaseURL: &url.URL{
Scheme: "https",
Host: "hub.example.com",
Path: "/",
},
Bind: ":3000",
Name: "WebSub",
}
}