config

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0, MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigAPI

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

func (*ConfigAPI) ConfigGet

func (configAPI *ConfigAPI) ConfigGet(dottedPath string) (interface{}, error)

ConfigGet gets config parameters from the given path. The path may be either a single field name, or a dotted path to a field.

func (*ConfigAPI) ConfigSet

func (configAPI *ConfigAPI) ConfigSet(dottedPath string, paramJSON string) error

ConfigSet sets the given parameters at the given path in the local config. The given path may be either a single field name, or a dotted path to a field. The JSON value may be either a single value or a whole data structure to be replace. For example: ConfigSet("datastore.path", "dev/null") and ConfigSet("datastore", "{\"path\":\"dev/null\"}") are the same operation.

type ConfigModule

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

configModule is plumbing implementation for setting and retrieving values from local config.

func NewConfigModule

func NewConfigModule(repo repo2.Repo) *ConfigModule

NewConfig returns a new configModule.

func (*ConfigModule) API

func (s *ConfigModule) API() *ConfigAPI

func (*ConfigModule) Get

func (s *ConfigModule) Get(dottedKey string) (interface{}, error)

Get gets a value from config

func (*ConfigModule) Set

func (s *ConfigModule) Set(dottedKey string, jsonString string) error

Set sets a value in config

Jump to

Keyboard shortcuts

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