console_config

package
v0.0.0-...-f34f428 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigLookup

func ConfigLookup(name string) (string, bool)

ConfigLookup looks up env var from the config database

func InitRepositoryProvider

func InitRepositoryProvider(databaseProvider string)

InitRepositoryProvider - One time init for the given DB Provider

func InitializeConfEnvProvider

func InitializeConfEnvProvider(configStore Repository) error

InitializeConfEnvProvider reads the config from the database

func MigrateSetupData

func MigrateSetupData(portal interfaces.PortalProxy, configStore Repository) error

MigrateSetupData will migrate the old data if needed

Types

type ConsoleConfigRepository

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

PostgresCNSIRepository is a PostgreSQL-backed ConsoleConfig repository

func (*ConsoleConfigRepository) DeleteConsoleConfig

func (c *ConsoleConfigRepository) DeleteConsoleConfig() error

DeleteConsoleConfig will delete all row(s) from the legacy config_config table

func (*ConsoleConfigRepository) DeleteValue

func (c *ConsoleConfigRepository) DeleteValue(group, key string) error

DeleteValue deletes a value from the config table

func (*ConsoleConfigRepository) GetConsoleConfig

func (c *ConsoleConfigRepository) GetConsoleConfig() (*interfaces.ConsoleConfig, error)

func (*ConsoleConfigRepository) GetValue

func (c *ConsoleConfigRepository) GetValue(group, key string) (string, bool, error)

GetValue will try and get the config value for the specified key

func (*ConsoleConfigRepository) GetValues

func (c *ConsoleConfigRepository) GetValues(group string) (map[string]string, error)

GetValues returns all values from the config table as a map

func (*ConsoleConfigRepository) SetValue

func (c *ConsoleConfigRepository) SetValue(group, name, value string) error

type Repository

type Repository interface {
	GetConsoleConfig() (*interfaces.ConsoleConfig, error)
	DeleteConsoleConfig() error

	// Access to the config data
	GetValue(group, name string) (string, bool, error)
	SetValue(group, name, value string) error
	DeleteValue(group, name string) error
	GetValues(group string) (map[string]string, error)
}

func NewPostgresConsoleConfigRepository

func NewPostgresConsoleConfigRepository(dcp *sql.DB) (Repository, error)

NewPostgresConsoleConfigRepository will create a new instance of the PostgresConsoleConfigRepository

Jump to

Keyboard shortcuts

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