provider

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package provider contains default implementations from config.Provider interface

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Default

type Default struct {
	// SourceName associated with this provider
	SourceName string
	// Default containing all properties associated with this provider
	Repository config.Repository
	// ValueResolver to retrieve and verify the existence of values in repository
	ValueResolver config.ValueResolver
	// ValueConverter is used to convert values providing from repository
	ValueConverter config.ValueConverter
}

Default implements config.Provider backed by a config.Repository

func (*Default) AllSettings

func (c *Default) AllSettings() map[string]interface{}

AllSettings returns all values associated with this provider as a map[string]interface{}.

func (*Default) Bool

func (c *Default) Bool(name string) bool

Bool returns a bool value associated with the key.

func (*Default) Float

func (c *Default) Float(name string) float64

Float returns a float value associated with the key.

func (*Default) Get

func (c *Default) Get(name string) (interface{}, bool)

Get returns the value associated with the key.

func (*Default) Int

func (c *Default) Int(name string) int

Int returns a int value associated with the key.

func (*Default) IsSet

func (c *Default) IsSet(name string) bool

IsSet returns if there's a value associated with the key.

func (*Default) Set

func (c *Default) Set(name string, value interface{}) interface{}

Set associates a value to to the key.

func (*Default) Source

func (c *Default) Source() string

Source returns the source name associated with this provider

func (*Default) String

func (c *Default) String(name string) string

String returns a string value associated with the key.

func (*Default) StringSlice

func (c *Default) StringSlice(name string) []string

StringSlice returns a string slice value associated with the key.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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