mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-31 10:42:01 +08:00

### Summary Add a web package for serving frontend #### Related Issues / PR's https://github.com/SigNoz/signoz/pull/5710
36 lines
708 B
Go
36 lines
708 B
Go
package config
|
|
|
|
import (
|
|
"context"
|
|
|
|
"go.signoz.io/signoz/pkg/instrumentation"
|
|
"go.signoz.io/signoz/pkg/web"
|
|
)
|
|
|
|
// Config defines the entire configuration of signoz.
|
|
type Config struct {
|
|
Instrumentation instrumentation.Config `mapstructure:"instrumentation"`
|
|
Web web.Config `mapstructure:"web"`
|
|
}
|
|
|
|
func New(ctx context.Context, settings ProviderSettings) (*Config, error) {
|
|
provider, err := NewProvider(settings)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return provider.Get(ctx)
|
|
}
|
|
|
|
func byName(name string) (any, bool) {
|
|
switch name {
|
|
case "instrumentation":
|
|
return &instrumentation.Config{}, true
|
|
case "web":
|
|
return &web.Config{}, true
|
|
default:
|
|
return nil, false
|
|
}
|
|
|
|
}
|