values

package
v0.0.78 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package values provides the functionality to store, retrieve and provide default configuration values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool interface {
	Get() bool
	Set(v bool)
	Attribute() output.Attribute
}

Bool interface to all Get, Set and exporting or `bool` values.

func NewDefaultBool

func NewDefaultBool(defVal bool, store Store, setting string) Bool

NewDefaultBool create the `Bool` value.

type DefaultBool

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

DefaultBool implementation of `Bool` interface

func (DefaultBool) Attribute

func (d DefaultBool) Attribute() output.Attribute

Attribute creates representation of the value to be used when exporting the configuration.

func (DefaultBool) Get

func (d DefaultBool) Get() bool

Get the value if set otherwise return default value.

func (DefaultBool) Set

func (d DefaultBool) Set(v bool)

Set the value and store it in configuration store.

type DefaultInt

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

DefaultInt implementation of `Int` interface.

func (DefaultInt) Attribute

func (d DefaultInt) Attribute() output.Attribute

Attribute creates representation of the value to be used when exporting the configuration.

func (DefaultInt) Get

func (d DefaultInt) Get() int

Get the value if set otherwise return default value.

func (DefaultInt) Set

func (d DefaultInt) Set(v int)

Set the value and store it in configuration store.

type DefaultString

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

DefaultString implementation of `String` interface.

func (DefaultString) Attribute

func (d DefaultString) Attribute() output.Attribute

Attribute creates representation of the value to be used when exporting the configuration.

func (DefaultString) Get

func (d DefaultString) Get() string

Get the value if set otherwise return default value.

func (DefaultString) Set

func (d DefaultString) Set(v string)

Set the value and store it in configuration store.

type DefaultStringSlice

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

DefaultStringSlice implementation of `StringSlice` interface.

func (DefaultStringSlice) Attribute

func (d DefaultStringSlice) Attribute() output.Attribute

Attribute creates representation of the value to be used when exporting the configuration.

func (DefaultStringSlice) Get

func (d DefaultStringSlice) Get() []string

Get the value if set otherwise return default value.

func (DefaultStringSlice) Set

func (d DefaultStringSlice) Set(v []string)

Set the value and store it in configuration store.

type Int

type Int interface {
	Get() int
	Set(v int)
	Attribute() output.Attribute
}

Int interface to all Get, Set and exporting or `int` values.

func NewDefaultInt

func NewDefaultInt(defVal int, store Store, setting string) Int

NewDefaultInt create the `Int` value.

type Store

type Store interface {
	GetString(key string) string
	GetStringSlice(key string) []string
	GetInt(key string) int
	GetBool(key string) bool
	IsSet(key string) bool
	Set(key string, value interface{})
}

Store provides the functions to retrieve values from configuration storage.

type String

type String interface {
	Get() string
	Set(v string)
	Attribute() output.Attribute
}

String interface to all Get, Set and exporting or `string` values.

func NewDefaultString

func NewDefaultString(defVal string, store Store, setting string) String

NewDefaultString create the `String` value.

type StringSlice

type StringSlice interface {
	Get() []string
	Set(v []string)
	Attribute() output.Attribute
}

StringSlice interface to all Get, Set and exporting of `[]string` values.

func NewDefaultStringSlice

func NewDefaultStringSlice(defVal []string, store Store, setting string) StringSlice

NewDefaultStringSlice create the `StringSlice` value.

Directories

Path Synopsis
Package valuestest is a generated GoMock package.
Package valuestest is a generated GoMock package.

Jump to

Keyboard shortcuts

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