config

package module
v0.0.0-...-2694d56 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: MIT Imports: 6 Imported by: 0

README

Rumors config plugin

Installation

go get github.com/rumorsflow/config

Documentation

Index

Constants

View Source
const PluginName string = "config"

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

type Plugin struct {
	Path    string
	Prefix  string
	Version string
	Cmd     string
	Timeout time.Duration
	// contains filtered or unexported fields
}

func (*Plugin) Get

func (p *Plugin) Get(name string) any

Get raw config in a form of config section.

func (*Plugin) GetCmd

func (p *Plugin) GetCmd() string

GetCmd returns cli command name

func (*Plugin) GetVersion

func (p *Plugin) GetVersion() string

GetVersion returns app version

func (*Plugin) GracefulTimeout

func (p *Plugin) GracefulTimeout() time.Duration

GracefulTimeout represents timeout for all servers registered in endure

func (*Plugin) Has

func (p *Plugin) Has(name string) bool

Has checks if config section exists.

func (*Plugin) Init

func (p *Plugin) Init() error

Init config provider.

func (*Plugin) Name

func (p *Plugin) Name() string

Name returns user-friendly plugin name

func (*Plugin) Overwrite

func (p *Plugin) Overwrite(values map[string]any) error

Overwrite overwrites existing config with provided values

func (*Plugin) Unmarshal

func (p *Plugin) Unmarshal(out any) error

func (*Plugin) UnmarshalKey

func (p *Plugin) UnmarshalKey(name string, out any) error

UnmarshalKey reads configuration section into configuration object.

Jump to

Keyboard shortcuts

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