-
Notifications
You must be signed in to change notification settings - Fork 11
/
config.go
29 lines (25 loc) · 1.5 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// SPDX-FileCopyrightText: 2023 PK Lab AG <contact@pklab.io>
// SPDX-License-Identifier: MIT
package main
import (
"github.com/celenium-io/celestia-indexer/internal/profiler"
indexerConfig "github.com/celenium-io/celestia-indexer/pkg/indexer/config"
"github.com/dipdup-net/go-lib/config"
)
type Config struct {
*config.Config `yaml:",inline"`
LogLevel string `validate:"omitempty,oneof=debug trace info warn error fatal panic" yaml:"log_level"`
ApiConfig ApiConfig `validate:"required" yaml:"api"`
Profiler *profiler.Config `validate:"omitempty" yaml:"profiler"`
Indexer indexerConfig.Indexer `validate:"required" yaml:"indexer"`
Environment string `validate:"omitempty,oneof=development production" yaml:"environment"`
}
type ApiConfig struct {
Bind string `validate:"required,hostname_port" yaml:"bind"`
RateLimit float64 `validate:"omitempty,min=0" yaml:"rate_limit"`
Prometheus bool `validate:"omitempty" yaml:"prometheus"`
RequestTimeout int `validate:"omitempty,min=1" yaml:"request_timeout"`
BlobReceiver string `validate:"required" yaml:"blob_receiver"`
SentryDsn string `validate:"omitempty" yaml:"sentry_dsn"`
Websocket bool `validate:"omitempty" yaml:"websocket"`
}