added ezconf and updated modules with integration

This commit is contained in:
2026-01-13 21:18:35 +11:00
parent f8919e8398
commit 0ceeb37058
22 changed files with 2448 additions and 3 deletions

36
tmdb/ezconf.go Normal file
View File

@@ -0,0 +1,36 @@
package tmdb
import "runtime"
// EZConfIntegration provides integration with ezconf for automatic configuration
type EZConfIntegration struct{}
// PackagePath returns the path to the tmdb package for source parsing
func (e EZConfIntegration) PackagePath() string {
_, filename, _, _ := runtime.Caller(0)
// Return directory of this file
return filename[:len(filename)-len("/ezconf.go")]
}
// ConfigFunc returns the NewAPIConnection function for ezconf
// Note: tmdb uses NewAPIConnection instead of ConfigFromEnv
func (e EZConfIntegration) ConfigFunc() func() (interface{}, error) {
return func() (interface{}, error) {
return NewAPIConnection()
}
}
// Name returns the name to use when registering with ezconf
func (e EZConfIntegration) Name() string {
return "tmdb"
}
// GroupName returns the display name for grouping environment variables
func (e EZConfIntegration) GroupName() string {
return "TMDB"
}
// NewEZConfIntegration creates a new EZConf integration helper
func NewEZConfIntegration() EZConfIntegration {
return EZConfIntegration{}
}