Documentation ¶
Overview ¶
Package config is responsible for reading and managing supervisor and planner configuration.
Index ¶
Constants ¶
const ( DefaultPort = 8080 DefaultLogLevel = "info" DefaultBaseFolder = "import" DefaultDropCypherFile = "drop.cypher" DefaultSchemaFolderName = "schema" DefaultSchemaMigrationType = "up_down" DefaultNodeLabel = "GraphToolMigration" DefaultNodeSubString = "Version" DefaultFolderMigrationType = "change" DefaultInitialBatch = "schema" DefaultNeo4jDatabase = "neo4j" DefaultCypherShellFormat = "auto" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchDetail ¶
type BatchDetail struct {
Folders []string `mapstructure:"folders"`
}
type Config ¶
type Config struct { Supervisor *Supervisor `mapstructure:"supervisor"` Planner *Planner `mapstructure:"planner"` }
func LoadFile ¶
LoadFile loads file into config, together with values from environment variables and default values.
func New ¶
New creates a new config containing values from environment variables and default values.
func (*Config) Normalize ¶
Normalize will set default values for some dynamic parts of config
It first calls Validate() to be sure all required structures are in place. This is only case, when function might return error. If you called Validate before, you are free to ignore this error.
func (*Config) Validate ¶
Validate validates that data in Config struct are filled in correctly. Supervisor is not required, but if it is present, is validate.
func (*Config) ValidateWithSupervisor ¶
ValidateWithSupervisor validates that data in Config struct are filled in correctly with mandatory supervisor part. This is like Validate() but if Supervisor is missing, error will be thrown.
type FolderDetail ¶
type Planner ¶
type Planner struct { Batches map[string]*BatchDetail `mapstructure:"batches"` SchemaFolder *SchemaFolder `mapstructure:"schema_folder"` Folders map[string]*FolderDetail `mapstructure:"folders"` AllowedCommands map[string]string `mapstructure:"allowed_commands"` BaseFolder string `mapstructure:"base_folder"` DropCypherFile string `mapstructure:"drop_cypher_file"` CypherShellFormat string `mapstructure:"cypher_shell_format"` }
type SchemaFolder ¶
type Supervisor ¶
type Supervisor struct { LogLevel string `mapstructure:"log_level"` DefaultGraphVersion string `mapstructure:"default_graph_version"` InitialBatch string `mapstructure:"initial_batch"` Neo4jAuth string `mapstructure:"neo4j_auth"` Neo4jDatabase string `mapstructure:"neo4j_database"` Port int `mapstructure:"port"` }