cli

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package cli created on 2017/6/22.

Index

Constants

View Source
const (
	Name = "CommandlineSource"
)

const.

Variables

This section is empty.

Functions

func NewCommandlineConfigSource

func NewCommandlineConfigSource() source.ConfigSource

NewCommandlineConfigSource defines a function used for creating configuration source.

Types

type Source

type Source struct {
	sync.RWMutex
	Configurations map[string]interface{}
	// contains filtered or unexported fields
}

Source is source for all configuration.

func (*Source) AddDimensionInfo

func (cli *Source) AddDimensionInfo(_ map[string]string) error

AddDimensionInfo is none function.

func (*Source) Cleanup

func (cli *Source) Cleanup() error

Cleanup cleans up a configuration.

func (*Source) Delete

func (cli *Source) Delete(_ string) error

Delete no use.

func (*Source) GetConfigurationByKey

func (cli *Source) GetConfigurationByKey(key string) (interface{}, error)

GetConfigurationByKey gets required configuration for matching key.

func (*Source) GetConfigurations

func (cli *Source) GetConfigurations() (map[string]interface{}, error)

GetConfigurations get configuration.

func (*Source) GetPriority

func (cli *Source) GetPriority() int

GetPriority gets the priority of a configuration.

func (*Source) GetSourceName

func (*Source) GetSourceName() string

GetSourceName gets the source's name of a configuration.

func (*Source) Set

func (cli *Source) Set(_ string, _ interface{}) error

Set no use.

func (*Source) SetPriority

func (cli *Source) SetPriority(priority int)

SetPriority custom priority.

func (*Source) Watch

func (*Source) Watch(_ source.EventHandler) error

Watch dynamically handles a configuration.

Jump to

Keyboard shortcuts

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