Documentation ¶
Overview ¶
Package configuration loads service configuration from the environment
Index ¶
Constants ¶
const ( // Online specifies that outbound connections are permitted. Online Mode = "online" // Offline specifies that outbound connections are not permitted. Offline Mode = "offline" // ModeEnv specifies the environment variable read to set the Mode ModeEnv = "MODE" // NetworkEnv specifies the environment variable to read Network/ChainId from NetworkEnv = "NETWORK" // PortEnv specifies the environment variable to read server port from PortEnv = "PORT" // KavaRPCURLEnv specifies the environment variable to read server port from KavaRPCURLEnv = "KAVA_RPC_URL" )
Variables ¶
var MiddlewareVersion = "0.0.1"
MiddlewareVersion represents the kava rosetta service version
Functions ¶
This section is empty.
Types ¶
type ConfigLoader ¶
ConfigLoader provides an interface for loading values from a string key
type Configuration ¶
type Configuration struct { Mode Mode NetworkIdentifier *types.NetworkIdentifier Port int KavaRPCURL string }
Configuration represents values to configure behavior of rosetta-kava and network to communicate with.
func LoadConfig ¶
func LoadConfig(loader ConfigLoader) (*Configuration, error)
LoadConfig loads keys from a provided loader and returns a complete Configuration reference for rosetta-kava
type EnvLoader ¶
type EnvLoader struct { }
EnvLoader loads keys from os environment and implements ConfigLoader
type Mode ¶
type Mode string
Mode identifies if the service is running in an 'online' or 'offline' capacity. Ref: https://www.rosetta-api.org/docs/node_deployment.html#multiple-modes
func ModeFromString ¶
ModeFromString returns a Mode from a string value