33 lines
766 B
Go
33 lines
766 B
Go
// Package config provides service-specific configuration.
|
|
package config
|
|
|
|
import (
|
|
"github.com/jordan/composed5/pkg/config"
|
|
)
|
|
|
|
// Config extends the base config with api-specific settings.
|
|
type Config struct {
|
|
config.AppConfig
|
|
Server config.ServerConfig
|
|
Database config.DatabaseConfig
|
|
Logging config.LoggingConfig
|
|
// Add service-specific config fields here
|
|
}
|
|
|
|
// Load reads configuration from environment variables.
|
|
func Load() (*Config, error) {
|
|
if err := config.Init(config.Options{
|
|
AppName: "api",
|
|
DefaultPort: 8001,
|
|
}); err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &Config{
|
|
AppConfig: config.ReadAppConfig(),
|
|
Server: config.ReadServerConfig(),
|
|
Database: config.ReadDatabaseConfig(),
|
|
Logging: config.ReadLoggingConfig(),
|
|
}, nil
|
|
}
|