morphconfig

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DialTimeoutDefault is a default dial timeout of morph chain client connection.
	DialTimeoutDefault = 5 * time.Second

	// CacheTTLDefault is a default value for cached values TTL.
	// It is 0, because actual default depends on block time.
	CacheTTLDefault = time.Duration(0)

	// ReconnectionRetriesNumberDefault is a default value for reconnection retries.
	ReconnectionRetriesNumberDefault = 5
	// ReconnectionRetriesDelayDefault is a default delay b/w reconnections.
	ReconnectionRetriesDelayDefault = 5 * time.Second
)

Variables

This section is empty.

Functions

func CacheTTL added in v0.32.0

func CacheTTL(c *config.Config) time.Duration

CacheTTL returns the value of "cache_ttl" config parameter from "morph" section.

Returns CacheTTLDefault if value is zero or invalid. Supports negative durations.

func DialTimeout

func DialTimeout(c *config.Config) time.Duration

DialTimeout returns the value of "dial_timeout" config parameter from "morph" section.

Returns DialTimeoutDefault if the value is not positive duration.

func Endpoints added in v0.37.0

func Endpoints(c *config.Config) []string

Endpoints returns list of the values of "endpoints" config parameter from "morph" section.

Throws panic if list is empty.

func ReconnectionRetriesDelay added in v0.37.0

func ReconnectionRetriesDelay(c *config.Config) time.Duration

ReconnectionRetriesDelay returns the value of "reconnections_delay" config parameter from "morph" section.

Returns 0 if value is not specified.

func ReconnectionRetriesNumber added in v0.37.0

func ReconnectionRetriesNumber(c *config.Config) int

ReconnectionRetriesNumber returns the value of "reconnections_number" config parameter from "morph" section.

Returns 0 if value is not specified.

Types

This section is empty.

Jump to

Keyboard shortcuts

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