conf

package
v1.2.10-beta14 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DevMode

func DevMode(field string)

func Get

func Get[T value](name string) (t T)

func GetSlice added in v1.2.10

func GetSlice[T value](name string) (t []T)

func OverrideRemote added in v1.2.2

func OverrideRemote(override bool)

func ProjectPath

func ProjectPath() (path string)

ProjectPath return project path

func Unmarshal

func Unmarshal(v any)

func UnmarshalField

func UnmarshalField(name string, v any)

Types

type Config

type Config struct {
	// different devMode yaml data
	YamlS []*Yaml
	// contains filtered or unexported fields
}

func Configger

func Configger(params ...string) *Config

Configger single config

func EmptyConfigger added in v1.2.2

func EmptyConfigger() *Config

func NewConfig

func NewConfig(params ...string) *Config

NewConfig new Config load all devMode yaml data

func (*Config) AddRemoteConfig added in v1.2.2

func (c *Config) AddRemoteConfig(remote *Remote)

func (*Config) Get

func (c *Config) Get(name string) (value any)

Get name

func (*Config) Unmarshal

func (c *Config) Unmarshal(s any)

func (*Config) UnmarshalField

func (c *Config) UnmarshalField(name string, s any)

UnmarshalField yaml to struct only support Accessible Field

func (*Config) WatchRemoteConfig added in v1.2.2

func (c *Config) WatchRemoteConfig()

func (*Config) WatchRemoteConfigFunc added in v1.2.2

func (c *Config) WatchRemoteConfigFunc(second int64, watchFunc watchFunc)

type Remote added in v1.2.2

type Remote struct {
	Provider string   `yaml:"provider"`
	Endpoint string   `yaml:"endpoint"`
	Path     []string `yaml:"path"`
}

type Yaml

type Yaml struct {
	*viper.Viper
	// contains filtered or unexported fields
}

func (*Yaml) Get

func (c *Yaml) Get(name string) any

func (*Yaml) Unmarshal

func (c *Yaml) Unmarshal(v any)

func (*Yaml) UnmarshalKey added in v1.2.2

func (c *Yaml) UnmarshalKey(key string, v any)

Jump to

Keyboard shortcuts

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