/go-envconfig-extra

Extra tools extending usage of go-envconfig library.

Primary LanguageGoApache License 2.0Apache-2.0

go-envconfig-extra

license release go.dev goreportcard issues sourcegraph

Extra tools extending usage of go-envconfig library.

install

go get github.com/b0ch3nski/go-envconfig-extra

example

import "github.com/b0ch3nski/go-envconfig-extra/envconfigext"

type Config struct {
	Password1 string `env:"PASS1,required" secret:"redact"`
	Password2 string `env:"PASS2,required" secret:"mask=4"`

	ArbitraryFile envconfigext.FileContent `env:"FILE"`
	Certificate   envconfigext.X509Cert    `env:"CERT"`
}

func (c Config) String() string {
	return envconfigext.StructFieldScan(c)
}