config

package
v0.7.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package config contains convenience functions for reading and managing viper configs.

Index

Constants

This section is empty.

Variables

View Source
var (

	// CfgVarCountView is the Open Census view for the cfgVarCount measure.
	CfgVarCountView = &view.View{
		Name:        "config/vars_total",
		Measure:     cfgVarCount,
		Description: "The number of config vars read during initialization",
		Aggregation: view.Count(),
	}
)

Functions

This section is empty.

Types

type Mutable

type Mutable interface {
	Set(string, interface{})
	View
}

Mutable is a read-write view of the Open Match configuration.

type View

type View interface {
	IsSet(string) bool
	GetString(string) string
	GetInt(string) int
	GetInt64(string) int64
	GetFloat64(string) float64
	GetStringSlice(string) []string
	GetBool(string) bool
	GetDuration(string) time.Duration
	GetStringMap(string) map[string]interface{}
}

View is a read-only view of the Open Match configuration. New accessors from Viper should be added here.

func Read

func Read() (View, error)

Read reads a config file into a viper.Viper instance and associates environment vars defined in config.envMappings

func Sub

func Sub(v View, key string) View

Sub returns a subset of configuration filtered by the key.

Jump to

Keyboard shortcuts

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