config

package
Version: v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2018 License: Apache-2.0 Imports: 6 Imported by: 63

Documentation

Overview

Package config provide methods to get the configurations reqruied by code in src/common

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileKeyProvider

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

FileKeyProvider reads key from file

func (*FileKeyProvider) Get

func (f *FileKeyProvider) Get(params map[string]interface{}) (string, error)

Get returns the key read from file

type KeyProvider

type KeyProvider interface {
	// Get returns the key
	// params can be used to pass parameters in different implements
	Get(params map[string]interface{}) (string, error)
}

KeyProvider provides the key used to encrypt and decrypt attrs

func NewFileKeyProvider

func NewFileKeyProvider(path string) KeyProvider

NewFileKeyProvider returns an instance of FileKeyProvider path: where the key should be read from

type Manager

type Manager struct {
	Cache bool
	// contains filtered or unexported fields
}

Manager manages configurations

func NewManager

func NewManager(client client.Client, enableCache bool) *Manager

NewManager returns an instance of Manager

func (*Manager) Get

func (m *Manager) Get() (map[string]interface{}, error)

Get : if cache is enabled, read configurations from cache, if cache is null or cache is disabled it loads configurations directly

func (*Manager) Load

func (m *Manager) Load() (map[string]interface{}, error)

Load configurations, if cache is enabled, cache the configurations

func (*Manager) Reset

func (m *Manager) Reset() error

Reset configurations

func (*Manager) Upload

func (m *Manager) Upload(cfgs map[string]interface{}) error

Upload configurations

Jump to

Keyboard shortcuts

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