config

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConfigProvider

func NewConfigProvider(app *foundation.Application) foundation.Provider

Types

type Config

type Config struct {
	Options *Options
	// contains filtered or unexported fields
}

Config represents the config.

func New

func New(options *Options) *Config

New returns a new config instance.

func (*Config) Add

func (c *Config) Add(key string, value interface{})

Add adds the key and value to the config.

func (*Config) Env

func (c *Config) Env(key string) interface{}

func (*Config) Get

func (c *Config) Get(key string) interface{}

Get returns the value by the key.

func (*Config) GetAll

func (c *Config) GetAll() map[string]interface{}

GetAll returns the all config.

func (*Config) GetBool

func (c *Config) GetBool(key string) bool

GetBool returns the bool by the key.

func (*Config) GetEnvPath

func (c *Config) GetEnvPath() string

GetEnvPath returns the env path.

func (*Config) GetOptions

func (c *Config) GetOptions() *Options

GetOptions returns the options.

func (*Config) GetString

func (c *Config) GetString(key string) string

GetString returns the string by the key.

func (*Config) Set

func (c *Config) Set(key string, value interface{})

Set sets the options.

type Options

type Options struct {
	EnvPath string
	Prefix  string
}

Options represents the config options.

func (*Options) GetEnvPath

func (o *Options) GetEnvPath() string

GetEnvPath returns the env path.

func (*Options) GetPrefix

func (o *Options) GetPrefix() string

GetPrefix returns the prefix.

func (*Options) Prepare

func (o *Options) Prepare()

Prepare prepares the config options.

type Provider

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

func (*Provider) Register

func (p *Provider) Register()

Jump to

Keyboard shortcuts

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