mconfig

package
v0.0.0-...-89602ce Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: BSD-3-Clause Imports: 14 Imported by: 16

Documentation

Overview

Package mconfig provides gateway Go support for cloud managed configuration (mconfig) Managed Configs are stored in proto JSON marshaled form in gateway.mconfig by external process (magmad) and periodically (MCONFOG_REFRESH_INTERVAL) refreshed by a dedicated routine

Package mconfig provides gateway Go support for cloud managed configuration (mconfig)

Package mconfig provides gateway Go support for cloud managed configuration (mconfig)

Index

Constants

View Source
const (
	DefaultConfigFileDir        = "/etc/magma"
	DefaultDynamicConfigFileDir = "/var/opt/magma/configs"
	ConfigFileDirEnv            = "MAGMA_CONFIG_LOCATION"
	MconfigFileName             = "gateway.mconfig"
	MconfigRefreshInterval      = time.Second * 120
)

Variables

This section is empty.

Functions

func ConfigFilePath

func ConfigFilePath() string

ConfigFilePath returns current GW mconfig file path

func CreateLoadTempConfig

func CreateLoadTempConfig(configJSON string) error

func DefaultConfigFilePath

func DefaultConfigFilePath() string

DefaultConfigFilePath returns default GW mconfig file path

func GetGatewayConfigs

func GetGatewayConfigs() *protos.GatewayConfigs

func GetServiceConfigs

func GetServiceConfigs(service string, result proto.Message) error

func Info

func Info() (fullPath string, fileInfo os.FileInfo)

Info returns last used mconfig file information

func RefreshConfigs

func RefreshConfigs() (string, error)

RefreshConfigs checks if Managed Config File's path or content has changed and tries to reload mamaged configs from the file refreshConfigs is thread safe and can be safely called while current configs are in use by other threads/routines

func RefreshConfigsFrom

func RefreshConfigsFrom(mcpath string) error

RefreshConfigsFrom checks if Managed Config File mcpath has changed and tries to reload mamaged configs from the file RefreshConfigsFrom is thread safe and can be safely called while current configs are in use by other threads/routines

func StopRefreshTicker

func StopRefreshTicker()

StopRefreshTicker stops refresh ticker

Types

This section is empty.

Directories

Path Synopsis
test

Jump to

Keyboard shortcuts

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