config

package
v0.0.0-...-e0cfe8b Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: BSD-3-Clause Imports: 8 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSettingNotFound indicates that a setting does not exist
	ErrSettingNotFound = errors.New("[Application] setting not found")
	// ErrInvalidSettingType returned when types of value and setting variable mismatch
	ErrInvalidSettingType = errors.New("[Application] wrong variable type")
)

Functions

func DefaultConfig

func DefaultConfig() *cctypes.Config

DefaultConfig returns an on-chain config instance with all reference fields initialized to non-nil values (this is needed for the reflection code in SetConfigSetting to work, for now...)

func SetConfigSetting

func SetConfigSetting(config interface{}, key, value string) error

SetConfigSetting sets value of a config field. The key can consist of one or two elements, e.g. "fieldA", "sectionA.fieldB". The value string should be parsable into a string, integer, or a BigUInt.

Types

This section is empty.

Jump to

Keyboard shortcuts

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