nodeconfig

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// PersistentStatePathDefault is a default path for persistent state file.
	PersistentStatePathDefault = ".neofs-storage-state"

	// NotificationTimeoutDefault is a default timeout for object notification operation.
	NotificationTimeoutDefault = 5 * time.Second
)

Variables

This section is empty.

Functions

func Attributes

func Attributes(c *config.Config) (attrs []string)

Attributes returns list of config parameters from "node" section that are set in "attribute_i" format, where i in range [0,100).

func BootstrapAddresses added in v0.22.0

func BootstrapAddresses(c *config.Config) (addr network.AddressGroup)

BootstrapAddresses returns value of "addresses" config parameter from "node" section as network.AddressGroup.

Panics if value is not a string list of valid NeoFS network addresses.

func Key

func Key(c *config.Config) *keys.PrivateKey

Key returns value of "key" config parameter from "node" section.

If value is not set, fallbacks to Wallet section.

Panics if value is incorrect filename of binary encoded private key.

func Relay

func Relay(c *config.Config) bool

Relay returns value of "relay" config parameter from "node" section.

Returns false if value is not set.

func Wallet added in v0.22.0

func Wallet(c *config.Config) *keys.PrivateKey

Wallet returns value of node private key from "node" section.

Panics if section contains invalid values.

Types

type NotificationConfig added in v0.28.0

type NotificationConfig struct {
	// contains filtered or unexported fields
}

NotificationConfig is a wrapper over "notification" config section which provides access to object notification configuration of node.

func Notification added in v0.28.0

func Notification(c *config.Config) NotificationConfig

Notification returns structure that provides access to "notification" subsection of "node" section.

func (NotificationConfig) CAPath added in v0.28.0

func (n NotificationConfig) CAPath() string

CAPath returns value of "ca_path" config parameter from "notification" subsection of "node" section.

Returns empty string if value is not presented.

func (NotificationConfig) CertPath added in v0.28.0

func (n NotificationConfig) CertPath() string

CertPath returns value of "certificate_path" config parameter from "notification" subsection of "node" section.

Returns empty string if value is not presented.

func (NotificationConfig) DefaultTopic added in v0.28.0

func (n NotificationConfig) DefaultTopic() string

DefaultTopic returns value of "default_topic" config parameter from "notification" subsection of "node" section.

Returns empty string if value is not presented.

func (NotificationConfig) Enabled added in v0.28.0

func (n NotificationConfig) Enabled() bool

Enabled returns value of "enabled" config parameter from "notification" subsection of "node" section.

Returns false if value is not presented.

func (NotificationConfig) Endpoint added in v0.28.0

func (n NotificationConfig) Endpoint() string

Endpoint returns value of "endpoint" config parameter from "notification" subsection of "node" section.

Returns empty string if value is not presented.

func (NotificationConfig) KeyPath added in v0.28.0

func (n NotificationConfig) KeyPath() string

KeyPath returns value of "key_path" config parameter from "notification" subsection of "node" section.

Returns empty string if value is not presented.

func (NotificationConfig) Timeout added in v0.28.0

func (n NotificationConfig) Timeout() time.Duration

Timeout returns value of "timeout" config parameter from "notification" subsection of "node" section.

Returns NotificationTimeoutDefault if value is not positive.

type PersistentSessionsConfig added in v0.28.0

type PersistentSessionsConfig struct {
	// contains filtered or unexported fields
}

PersistentSessionsConfig is a wrapper over "persistent_sessions" config section which provides access to persistent session tokens storage configuration of node.

func PersistentSessions added in v0.28.0

func PersistentSessions(c *config.Config) PersistentSessionsConfig

PersistentSessions returns structure that provides access to "persistent_sessions" subsection of "node" section.

func (PersistentSessionsConfig) Path added in v0.28.0

Path returns value of "path" config parameter.

Returns PersistentStatePathDefault if value is not a non-empty string.

type PersistentStateConfig added in v0.24.1

type PersistentStateConfig struct {
	// contains filtered or unexported fields
}

PersistentStateConfig is a wrapper over "persistent_state" config section which provides access to persistent state storage configuration of node.

func PersistentState added in v0.24.1

func PersistentState(c *config.Config) PersistentStateConfig

PersistentState returns structure that provides access to "persistent_state" subsection of "node" section.

func (PersistentStateConfig) Path added in v0.24.1

func (p PersistentStateConfig) Path() string

Path returns value of "path" config parameter.

Returns PersistentStatePathDefault if value is not a non-empty string.

type SubnetConfig added in v0.27.0

type SubnetConfig config.Config

SubnetConfig represents node configuration related to subnets.

func (SubnetConfig) ExitZero added in v0.27.0

func (x SubnetConfig) ExitZero() bool

ExitZero returns value of "exit_zero" config parameter as bool. Returns false if value can not be cast.

func (*SubnetConfig) Init added in v0.27.0

func (x *SubnetConfig) Init(root config.Config)

Init initializes SubnetConfig from "subnet" sub-section of "node" section of the root config.

func (SubnetConfig) IterateSubnets added in v0.27.0

func (x SubnetConfig) IterateSubnets(f func(string))

IterateSubnets casts value of "entries" config parameter to string slice, iterates over all of its elements and passes them to f.

Does nothing if value can not be cast to string slice.

Jump to

Keyboard shortcuts

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