Documentation ¶
Index ¶
- Constants
- func Exist(path string) (bool, error)
- type APIConfig
- type Config
- type DbConfig
- type GatewayConfig
- type JWTConfig
- type Libp2pNetConfig
- type LogConfig
- type MessageServiceConfig
- type MessageStateConfig
- type MySqlConfig
- type NodeConfig
- type PublisherConfig
- type RateLimitConfig
- type SqliteConfig
Constants ¶
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { DB DbConfig `toml:"db"` JWT JWTConfig `toml:"jwt"` Log LogConfig `toml:"log"` API APIConfig `toml:"api"` Node NodeConfig `toml:"node"` MessageService MessageServiceConfig `toml:"messageService"` Gateway GatewayConfig `toml:"gateway"` RateLimit RateLimitConfig `toml:"rateLimit"` Trace *metrics.TraceConfig `toml:"tracing"` Metrics *metrics.MetricsConfig `toml:"metrics"` Libp2pNet *Libp2pNetConfig `toml:"libp2p"` Publisher *PublisherConfig `toml:"publisher"` }
func DefaultConfig ¶
func DefaultConfig() *Config
type DbConfig ¶
type DbConfig struct { Type string `toml:"type"` MySql MySqlConfig `toml:"mysql"` Sqlite SqliteConfig `toml:"sqlite"` }
type GatewayConfig ¶
type Libp2pNetConfig ¶
type Libp2pNetConfig struct { ListenAddress string `toml:"listenAddresses"` BootstrapAddresses []string `toml:"bootstrapAddresses"` // MinPeerThreshold determine when to expand peers. // default set to 0 which means use network default config. MinPeerThreshold int `toml:"minPeerThreshold"` // ExpandPeriod determine how often to expand peers. // default set to "0s" which means use network default config. // otherwise, it should be a duration string like "5s", "30s". ExpandPeriod time.Duration `toml:"expandPeriod"` }
type MessageServiceConfig ¶
type MessageServiceConfig struct { WaitingChainHeadStableDuration time.Duration `toml:"WaitingChainHeadStableDuration"` DefaultTimeout time.Duration `toml:"DefaultTimeout"` SignMessageTimeout time.Duration `toml:"SignMessageTimeout"` EstimateMessageTimeout time.Duration `toml:"EstimateMessageTimeout"` SkipProcessHead bool `toml:"skipProcessHead"` SkipPushMessage bool `toml:"skipPushMessage"` }
type MessageStateConfig ¶
type MySqlConfig ¶
type NodeConfig ¶
type PublisherConfig ¶
type PublisherConfig struct { // CacheReleasePeriod is the period to release massage cache with unit of second. // default is 5. // set a negative int means disable cache. Concurrency int `toml:"concurrency"` // CacheReleasePeriod is the period to release massage cache with unit of second. // default is 0 which means auto decide by network parameters that is 1/3 of the block time. // set a negative int means disable cache CacheReleasePeriod int64 `toml:"cacheReleasePeriod"` EnableP2P bool `toml:"enablePubsub"` EnableMultiNode bool `toml:"enableMultiNode"` }
type RateLimitConfig ¶
type RateLimitConfig struct {
Redis string `toml:"redis"`
}
type SqliteConfig ¶
type SqliteConfig struct {
Debug bool `toml:"debug"`
}
Click to show internal directories.
Click to hide internal directories.