Exports OTEL initialization function and adds extensive documentation across packages for improved clarity.
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/logging"
|
||||
)
|
||||
|
||||
// Helper function to return a context loaded up with
|
||||
// MustSetupConfigAndLogging is a helper function to return a context loaded up with
|
||||
// config.AppConfig and a logger
|
||||
func MustSetupConfigAndLogging(ctx context.Context) context.Context {
|
||||
ctx, err := config.LoadConfig(ctx)
|
||||
@@ -24,7 +24,7 @@ func MustSetupConfigAndLogging(ctx context.Context) context.Context {
|
||||
return ctx
|
||||
}
|
||||
|
||||
// Unmarshal config into a custom type
|
||||
// MustSetupConfigAndLoggingInto will unmarshal config into a custom type
|
||||
// Type MUST include *config.AppConfig
|
||||
// Stored in context as *config.AppConfig but can be asserted back
|
||||
func MustSetupConfigAndLoggingInto[T any](ctx context.Context, into T) (context.Context, T) {
|
||||
|
Reference in New Issue
Block a user