config

package
v0.0.0-...-621fd20 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2020 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IniFile

type IniFile map[string]Section

IniFile abstraction

func (IniFile) AddSection

func (i IniFile) AddSection(name string)

AddSection extends IniFile with new sections. If section exists method does nothing

func (IniFile) GetSection

func (i IniFile) GetSection(name string) (map[string]string, error)

GetSection returns articular section of the config file

func (IniFile) GetValue

func (i IniFile) GetValue(section, key string) (string, error)

GetValue returns value for particular key in particular section

func (IniFile) HasKey

func (i IniFile) HasKey(section, key string) bool

func (IniFile) HasSection

func (i IniFile) HasSection(name string) bool

func (IniFile) Merge

func (i IniFile) Merge(src IniFile)

Merge another IniFile content

func (IniFile) SetValue

func (i IniFile) SetValue(section, key, value string, create bool) error

SetValue sets value of the key of a section

func (IniFile) ToString

func (i IniFile) ToString() string

ToString convert Ini config to string

type Policy

type Policy map[string]string

Policy abstraction for service policy.yaml

func (Policy) Merge

func (p Policy) Merge(src Policy)

Merge configuration to object

func (Policy) ToString

func (p Policy) ToString() string

ToString returns string representation of the object

type Section

type Section map[string]string

Section abstraction

Jump to

Keyboard shortcuts

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