Documentation
¶
Index ¶
- Constants
- type ApiConnectorConfig
- type ApiConnectorType
- type AppConfig
- type AppStorageConfig
- type AuthConfig
- type AuthContracts
- type AuthMethods
- type CacheConfig
- type CacheConnectorConfig
- type CacheConnectorDriver
- type CachePolicyConfig
- type ChainDefaults
- type DrpcIntegrationConfig
- type DrpcKeyConfig
- type DrpcOwnerConfig
- type ExternalKeyConfig
- type FailsafeConfig
- type FinalizationType
- type HedgeConfig
- type IntegrationConfig
- type IntegrationKeyConfig
- type IntegrityConfig
- type JwtRequestStrategyConfig
- type KeyConfig
- type KeySettingsConfig
- type KeyType
- type LocalKeyConfig
- type MemoryCacheConnectorConfig
- type MethodsConfig
- type PostgresCacheConnectorConfig
- type PostgresStorageConfig
- type PyroscopeConfig
- type RateLimitAutoTuneConfig
- type RateLimitBudget
- type RateLimitBudgetsConfig
- type RateLimitEngine
- type RateLimitRule
- type RateLimiterConfig
- type RedisCacheConnectorConfig
- type RedisRateLimitEngineConfig
- type RedisStorageConfig
- type RedisStoragePoolConfig
- type RedisStorageTimeoutsConfig
- type RequestStrategyConfig
- type RequestStrategyType
- type RetryConfig
- type ScorePolicyConfig
- type ServerConfig
- type TimeoutConfig
- type TlsConfig
- type TokenRequestStrategyConfig
- type Upstream
- type UpstreamConfig
- type UpstreamOptions
Constants ¶
View Source
const ( AppName = "nodecore" DefaultConfigPath = "./nodecore.yml" ConfigPathVar = "NODECORE_CONFIG_PATH" )
View Source
const ( DefaultLatencyPolicyFuncName = "defaultLatencyPolicyFunc" DefaultLatencyErrorRatePolicyFuncName = "defaultLatencyErrorRatePolicyFunc" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiConnectorConfig ¶
type ApiConnectorConfig struct {
Type ApiConnectorType `yaml:"type"`
Url string `yaml:"url"`
Headers map[string]string `yaml:"headers,omitempty"`
Ca string `yaml:"ca"`
}
type ApiConnectorType ¶
type ApiConnectorType string
const ( JsonRpc ApiConnectorType = "json-rpc" Rest ApiConnectorType = "rest" Grpc ApiConnectorType = "grpc" Ws ApiConnectorType = "websocket" )
type AppConfig ¶
type AppConfig struct {
ServerConfig *ServerConfig `yaml:"server"`
UpstreamConfig *UpstreamConfig `yaml:"upstream-config"`
CacheConfig *CacheConfig `yaml:"cache"`
AuthConfig *AuthConfig `yaml:"auth"`
RateLimit []RateLimitBudgetsConfig `yaml:"rate-limit"`
AppStorages []AppStorageConfig `yaml:"app-storages"`
IntegrationConfig *IntegrationConfig `yaml:"integration"`
}
func NewAppConfig ¶
type AppStorageConfig ¶
type AppStorageConfig struct {
Name string `yaml:"name"`
Redis *RedisStorageConfig `yaml:"redis"`
Postgres *PostgresStorageConfig `yaml:"postgres"`
}
type AuthConfig ¶
type AuthConfig struct {
Enabled bool `yaml:"enabled"`
RequestStrategyConfig *RequestStrategyConfig `yaml:"request-strategy"`
KeyConfigs []*KeyConfig `yaml:"key-management"`
}
type AuthContracts ¶
type AuthContracts struct {
Allowed []string `yaml:"allowed"`
}
type AuthMethods ¶
type CacheConfig ¶
type CacheConfig struct {
ReceiveTimeout time.Duration `yaml:"receive-timeout"`
CacheConnectors []*CacheConnectorConfig `yaml:"connectors"`
CachePolicies []*CachePolicyConfig `yaml:"policies"`
}
type CacheConnectorConfig ¶
type CacheConnectorConfig struct {
Id string `yaml:"id"`
Driver CacheConnectorDriver `yaml:"driver"`
Redis *RedisCacheConnectorConfig `yaml:"redis"`
Memory *MemoryCacheConnectorConfig `yaml:"memory"`
Postgres *PostgresCacheConnectorConfig `yaml:"postgres"`
}
type CacheConnectorDriver ¶
type CacheConnectorDriver string
const ( Memory CacheConnectorDriver = "memory" Redis CacheConnectorDriver = "redis" Postgres CacheConnectorDriver = "postgres" )
type CachePolicyConfig ¶
type CachePolicyConfig struct {
Id string `yaml:"id"`
Chain string `yaml:"chain"`
Method string `yaml:"method"`
FinalizationType FinalizationType `yaml:"finalization-type"`
CacheEmpty bool `yaml:"cache-empty"`
Connector string `yaml:"connector-id"`
ObjectMaxSize string `yaml:"object-max-size"`
TTL string `yaml:"ttl"`
}
type ChainDefaults ¶
type ChainDefaults struct {
PollInterval time.Duration `yaml:"poll-interval"`
Options *UpstreamOptions `yaml:"options"`
}
type DrpcIntegrationConfig ¶
type DrpcKeyConfig ¶
type DrpcKeyConfig struct {
Owner *DrpcOwnerConfig `yaml:"owner"`
}
type DrpcOwnerConfig ¶
type ExternalKeyConfig ¶
type ExternalKeyConfig struct {
}
type FailsafeConfig ¶
type FailsafeConfig struct {
HedgeConfig *HedgeConfig `yaml:"hedge"`
TimeoutConfig *TimeoutConfig `yaml:"timeout"`
RetryConfig *RetryConfig `yaml:"retry"`
}
type FinalizationType ¶
type FinalizationType string
const ( Finalized FinalizationType = "finalized" None FinalizationType = "none" )
type HedgeConfig ¶
type IntegrationConfig ¶
type IntegrationConfig struct {
Drpc *DrpcIntegrationConfig `yaml:"drpc"`
}
type IntegrationKeyConfig ¶
type IntegrationKeyConfig interface {
// contains filtered or unexported methods
}
type IntegrityConfig ¶
type IntegrityConfig struct {
Enabled bool `yaml:"enabled"`
}
type KeyConfig ¶
type KeyConfig struct {
Id string `yaml:"id"`
Type KeyType `yaml:"type"`
LocalKeyConfig *LocalKeyConfig `yaml:"local"`
DrpcKeyConfig *DrpcKeyConfig `yaml:"drpc"`
}
type KeySettingsConfig ¶
type KeySettingsConfig struct {
AllowedIps []string `yaml:"allowed-ips"`
Methods *AuthMethods `yaml:"methods"`
AuthContracts *AuthContracts `yaml:"contracts"`
CorsOrigins []string `yaml:"cors-origins"`
}
type LocalKeyConfig ¶
type LocalKeyConfig struct {
Key string `yaml:"key"`
KeySettingsConfig *KeySettingsConfig `yaml:"settings"`
}
type MethodsConfig ¶
type PostgresStorageConfig ¶
type PostgresStorageConfig struct {
Url string `yaml:"url"`
}
type PyroscopeConfig ¶
type PyroscopeConfig struct {
Enabled bool `yaml:"enabled"`
Url string `yaml:"url"`
Username string `yaml:"username"`
Password string `yaml:"password"`
}
func (*PyroscopeConfig) GetServerAddress ¶
func (p *PyroscopeConfig) GetServerAddress() string
func (*PyroscopeConfig) GetServerPassword ¶
func (p *PyroscopeConfig) GetServerPassword() string
func (*PyroscopeConfig) GetServerUsername ¶
func (p *PyroscopeConfig) GetServerUsername() string
type RateLimitAutoTuneConfig ¶
type RateLimitBudget ¶
type RateLimitBudget struct {
Name string `yaml:"name"`
Storage string `yaml:"storage"`
Config *RateLimiterConfig `yaml:"config"`
}
type RateLimitBudgetsConfig ¶
type RateLimitBudgetsConfig struct {
DefaultStorage string `yaml:"default-engine"`
Budgets []RateLimitBudget `yaml:"budgets"`
}
type RateLimitEngine ¶
type RateLimitEngine struct {
Name string `yaml:"name"`
Type string `yaml:"type"`
Redis *RedisRateLimitEngineConfig `yaml:"redis"`
}
type RateLimitRule ¶
type RateLimiterConfig ¶
type RateLimiterConfig struct {
Rules []RateLimitRule `yaml:"rules"`
}
type RedisCacheConnectorConfig ¶
type RedisCacheConnectorConfig struct {
StorageName string `yaml:"storage-name"`
}
type RedisRateLimitEngineConfig ¶
type RedisRateLimitEngineConfig struct {
StorageName string `yaml:"storage-name"`
}
type RedisStorageConfig ¶
type RedisStorageConfig struct {
FullUrl string `yaml:"full-url"`
Address string `yaml:"address"`
Username string `yaml:"username"`
Password string `yaml:"password"`
DB *int `yaml:"db"`
Timeouts *RedisStorageTimeoutsConfig `yaml:"timeouts"`
Pool *RedisStoragePoolConfig `yaml:"pool"`
}
type RedisStoragePoolConfig ¶
type RedisStoragePoolConfig struct {
Size int `yaml:"size"`
PoolTimeout *time.Duration `yaml:"pool-timeout"`
MinIdleConns int `yaml:"min-idle-conns"`
MaxIdleConns int `yaml:"max-idle-conns"`
MaxActiveConns int `yaml:"max-active-conns"`
ConnMaxIdleTime *time.Duration `yaml:"conn-max-idle-time"`
ConnMaxLifeTime *time.Duration `yaml:"conn-max-life-time"`
}
type RequestStrategyConfig ¶
type RequestStrategyConfig struct {
Type RequestStrategyType `yaml:"type"`
TokenRequestStrategyConfig *TokenRequestStrategyConfig `yaml:"token"`
JwtRequestStrategyConfig *JwtRequestStrategyConfig `yaml:"jwt"`
}
type RequestStrategyType ¶
type RequestStrategyType string
const ( Token RequestStrategyType = "token" Jwt RequestStrategyType = "jwt" )
type RetryConfig ¶
type ScorePolicyConfig ¶
type ScorePolicyConfig struct {
CalculationInterval time.Duration `yaml:"calculation-interval"`
CalculationFunctionName string `yaml:"calculation-function-name"` // a func name from a 'defaultRatingFunctions' map
CalculationFunctionFilePath string `yaml:"calculation-function-file-path"` // a path to the file with a function
// contains filtered or unexported fields
}
func (*ScorePolicyConfig) GetScoreFunc ¶
func (s *ScorePolicyConfig) GetScoreFunc() (goja.Callable, error)
type ServerConfig ¶
type TimeoutConfig ¶
type TokenRequestStrategyConfig ¶
type TokenRequestStrategyConfig struct {
Value string `yaml:"value"`
}
type Upstream ¶
type Upstream struct {
Id string `yaml:"id"`
ChainName string `yaml:"chain"`
Connectors []*ApiConnectorConfig `yaml:"connectors"`
HeadConnector ApiConnectorType `yaml:"head-connector"`
PollInterval time.Duration `yaml:"poll-interval"`
Methods *MethodsConfig `yaml:"methods"`
FailsafeConfig *FailsafeConfig `yaml:"failsafe-config"`
Options *UpstreamOptions `yaml:"options"`
RateLimitBudget string `yaml:"rate-limit-budget"`
RateLimit *RateLimiterConfig `yaml:"rate-limit"`
RateLimitAutoTune *RateLimitAutoTuneConfig `yaml:"rate-limit-auto-tune"`
}
type UpstreamConfig ¶
type UpstreamConfig struct {
Upstreams []*Upstream `yaml:"upstreams"`
ChainDefaults map[string]*ChainDefaults `yaml:"chain-defaults"`
FailsafeConfig *FailsafeConfig `yaml:"failsafe-config"`
ScorePolicyConfig *ScorePolicyConfig `yaml:"score-policy-config"`
IntegrityConfig *IntegrityConfig `yaml:"integrity"`
}
type UpstreamOptions ¶
type UpstreamOptions struct {
InternalTimeout time.Duration `yaml:"internal-timeout"`
ValidationInterval time.Duration `yaml:"validation-interval"`
DisableValidation *bool `yaml:"disable-validation"`
DisableSettingsValidation *bool `yaml:"disable-settings-validation"`
DisableChainValidation *bool `yaml:"disable-chain-validation"`
}
Click to show internal directories.
Click to hide internal directories.