eviper

package module
v0.0.1 Latest Latest
Warning

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

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

README

eviper

Exends viper to rewrite values from another source

Todos

  • Tests
  • Lint
package main

import (
	"github.com/spf13/viper"
	"github.com/Alexitdv/eviper"
)

type Opts struct {
	Addr string `env:"ADDR"`
}

func main() {
	c := eviper.New(viper.New())
	c.AutomaticEnv()
	c.AddConfigPath("./configs/local")
	c.SetConfigName("service")
	c.SetConfigType("toml")
	err = c.Unmarshal(&conf) // Unmarshal to struct if needed
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EViper

type EViper struct {
	*viper.Viper
}

func New

func New(v *viper.Viper) *EViper

func (*EViper) Unmarshal

func (e *EViper) Unmarshal(rawVal interface{}) error

Jump to

Keyboard shortcuts

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