mirror of
https://github.com/eosswedenorg/thalos
synced 2026-08-30 20:58:12 +02:00
rename app folder to internal.
This commit is contained in:
parent
afb90af1db
commit
9974bfe3fd
28 changed files with 23 additions and 23 deletions
65
internal/config/config.go
Normal file
65
internal/config/config.go
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/eosswedenorg/thalos/internal/log"
|
||||
|
||||
shipclient "github.com/eosswedenorg-go/antelope-ship-client"
|
||||
)
|
||||
|
||||
type RedisConfig struct {
|
||||
Addr string `yaml:"addr"`
|
||||
User string `yaml:"user"`
|
||||
Password string `yaml:"password"`
|
||||
DB int `yaml:"db"`
|
||||
Prefix string `yaml:"prefix"`
|
||||
}
|
||||
|
||||
type TelegramConfig struct {
|
||||
Id string `yaml:"id"`
|
||||
Channel int64 `yaml:"channel"`
|
||||
}
|
||||
|
||||
type ShipConfig struct {
|
||||
Url string `yaml:"url"`
|
||||
IrreversibleOnly bool `yaml:"irreversible_only"`
|
||||
MaxMessagesInFlight uint32 `yaml:"max_messages_in_flight"`
|
||||
StartBlockNum uint32 `yaml:"start_block_num"`
|
||||
EndBlockNum uint32 `yaml:"end_block_num"`
|
||||
Chain string `yaml:"chain"`
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Name string `yaml:"name"`
|
||||
Ship ShipConfig `yaml:"ship"`
|
||||
Api string `yaml:"api"`
|
||||
|
||||
Log log.Config `yaml:"log"`
|
||||
|
||||
Redis RedisConfig `yaml:"redis"`
|
||||
MessageCodec string `yaml:"message_codec"`
|
||||
|
||||
Telegram TelegramConfig `yaml:"telegram"`
|
||||
}
|
||||
|
||||
// Create a new Config object with default values
|
||||
func New() Config {
|
||||
return Config{
|
||||
MessageCodec: "json",
|
||||
Log: log.Config{
|
||||
MaxFileSize: 10 * 1000 * 1000, // 10 mb
|
||||
MaxTime: time.Hour * 24,
|
||||
},
|
||||
Ship: ShipConfig{
|
||||
StartBlockNum: shipclient.NULL_BLOCK_NUMBER,
|
||||
EndBlockNum: shipclient.NULL_BLOCK_NUMBER,
|
||||
MaxMessagesInFlight: 10,
|
||||
IrreversibleOnly: false,
|
||||
},
|
||||
Redis: RedisConfig{
|
||||
Addr: "localhost:6379",
|
||||
Prefix: "ship",
|
||||
},
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue