config

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Modes = map[string]bool{
	"registry":      true,
	"manager":       true,
	"token":         true,
	"notifications": true,
	"all":           true,
}

Functions

This section is empty.

Types

type API

type API struct {
	// Route is the URL router where the API will be served
	Route string
	// ListenPort port where the API server will listen on
	ListenPort int
	// ListenHost host where the API server will listen on
	ListenHost string
	// Ssl tls related config options
	Ssl struct {
		Domain  string
		DirCert string
	}
}

type DB

type DB struct {
	Host     string
	Port     int
	User     string
	Password string
	Dbname   string
	Sslmode  string
}

type Error

type Error struct {
	// Critical indicates if the error encountered is critical and the app must be stopped
	Critical bool
	// Message error message
	Message string
}

type Manager

type Manager struct {
	// API api config options
	API *API
	// Database connection options
	DB *DB
	// SMTP options
	SMTP *SMTP
	// LogLevel logging level
	LogLevel string
	// LogOutput logging output
	LogOutput string
	// ErrorLogFile for logging warning, error and fatal messages
	LogErrorFile string
	// Metrics config options
	Metrics *MetricsCfg
	// Mode is the main operation mode
	Mode string
	// DataDir path where the gateway files will be stored
	DataDir string
	// SaveConfig overwrites the config file with the CLI provided flags
	SaveConfig bool
	// SigningKey is the ECDSA hexString private key for signing messages
	SigningKey string
	// Migration options
	Migrate *Migrate
}

func NewManagerConfig added in v0.6.1

func NewManagerConfig() *Manager

NewManagerConfig initializes the fields in the config stuct

func (*Manager) String added in v0.6.1

func (m *Manager) String() string

func (*Manager) ValidMode

func (m *Manager) ValidMode() bool

type MetricsCfg

type MetricsCfg struct {
	Enabled         bool
	RefreshInterval int
}

MetricsCfg initializes the metrics config

type Migrate

type Migrate struct {
	// Action defines the migration action to be taken (up, down, status)
	Action string
}

type Notifications added in v0.6.0

type Notifications struct {
	Service int
	KeyFile string
}

type Notify added in v0.6.1

type Notify struct {
	// API api config options
	API *API
	// Database connection options
	DB *DB
	// LogLevel logging level
	LogLevel string
	// LogOutput logging output
	LogOutput string
	// ErrorLogFile for logging warning, error and fatal messages
	LogErrorFile string
	// Metrics config options
	Metrics *MetricsCfg
	// DataDir path where the gateway files will be stored
	DataDir string
	// SaveConfig overwrites the config file with the CLI provided flags
	SaveConfig bool
	// SigningKey is the ECDSA hexString private key for signing messages
	SigningKey string
	// Env {dev, stage, default: main}
	Env string
	// Notifications
	Notifications *Notifications
	// Ethereum node config
	Ethereum *config.EthCfg
	// Web3 endpoint config
	Web3 *config.W3Cfg
	// EthereumEvents ethereum even subscription config options
	EthereumEvents *config.EthEventCfg
	// IPFS config options
	IPFS *config.IPFSCfg
}

func NewNotifyConfig added in v0.6.1

func NewNotifyConfig() *Notify

NewNotifyConfig initializes the fields in the config stuct

func (*Notify) String added in v0.6.1

func (n *Notify) String() string

type SMTP added in v0.6.1

type SMTP struct {
	Host          string
	Port          int
	User          string
	Password      string
	PoolSize      int
	Timeout       int
	ValidationURL string
	Sender        string
	SenderName    string
	Contact       string
}

Jump to

Keyboard shortcuts

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