config

package
v0.0.0-...-e67266d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const EntityCacheKey = "entity"

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	MaxSize int `yaml:"maxSize"`
}

type Config

type Config struct {
	Cache               map[string]Cache
	Db                  Db
	Feature             Feature
	Http                Http
	Log                 Log
	Network             string
	NodeRefreshInterval time.Duration `yaml:"nodeRefreshInterval"`
	NodeVersion         string        `yaml:"nodeVersion"`
	Nodes               NodeMap
	Online              bool
	Port                uint16
	Realm               int64
	Response            Response
	Shard               int64
	ShutdownTimeout     time.Duration `yaml:"shutdownTimeout"`
}

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig loads configuration from yaml files and env variables

type Db

type Db struct {
	Host             string
	Name             string
	Password         string
	Pool             Pool
	Port             uint16
	StatementTimeout int `yaml:"statementTimeout"`
	Username         string
}

func (Db) GetDsn

func (db Db) GetDsn() string

type Feature

type Feature struct {
	SubNetworkIdentifier bool `yaml:"subNetworkIdentifier"`
}

type Http

type Http struct {
	IdleTimeout       time.Duration `yaml:"idleTimeout"`
	ReadTimeout       time.Duration `yaml:"readTimeout"`
	ReadHeaderTimeout time.Duration `yaml:"readHeaderTimeout"`
	WriteTimeout      time.Duration `yaml:"writeTimeout"`
}

type Log

type Log struct {
	Level string
}

type NodeMap

type NodeMap map[string]hiero.AccountID

type Pool

type Pool struct {
	MaxIdleConnections int `yaml:"maxIdleConnections"`
	MaxLifetime        int `yaml:"maxLifetime"`
	MaxOpenConnections int `yaml:"maxOpenConnections"`
}

type Response

type Response struct {
	MaxTransactionsInBlock int `yaml:"maxTransactionsInBlock"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL