Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 1.39 KB

README.md

File metadata and controls

33 lines (25 loc) · 1.39 KB

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)
}