Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( DefaultWriter = dotenvWriter // A map of all writers available. FromName = map[string]Writer{ dotenvWriter.Name(): dotenvWriter, ghaEnvWriter.Name(): ghaEnvWriter, ghaMaskWriter.Name(): ghaMaskWriter, } )
Functions ¶
This section is empty.
Types ¶
type DotenvWriter ¶
type DotenvWriter struct{}
Outputs the values in .env file format
func (*DotenvWriter) FormatEnvironmentValues ¶
func (*DotenvWriter) Name ¶
func (*DotenvWriter) Name() string
type GHAEnvWriter ¶ added in v0.0.4
type GHAEnvWriter struct{}
Outputs values in a format that can be parsed by GHA's `GITHUB_ENV` file. This is _almost_ the same as dotenv files, but also handles multiline environment values. For details, see https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-environment-variable
func NewGHAEnvWriter ¶ added in v0.0.4
func NewGHAEnvWriter() *GHAEnvWriter
Create a new GHA env writer
func (*GHAEnvWriter) FormatEnvironmentValues ¶ added in v0.0.4
func (*GHAEnvWriter) Name ¶ added in v0.0.4
func (*GHAEnvWriter) Name() string
type GHAMaskWriter ¶ added in v0.0.3
type GHAMaskWriter struct{}
Outputs secret values prefixed with `::add-mask::`, one per line. Per GHA docs, this will prevent the values from being logged. For details, see https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#masking-a-value-in-a-log
func NewGHAMaskWriter ¶ added in v0.0.3
func NewGHAMaskWriter() *GHAMaskWriter
Create a new GHA mask writer
func (*GHAMaskWriter) FormatEnvironmentValues ¶ added in v0.0.3
func (*GHAMaskWriter) Name ¶ added in v0.0.3
func (*GHAMaskWriter) Name() string
type Writer ¶
type Writer interface {
// Take in environment key/value pairs and format them.
FormatEnvironmentValues(values map[string]values.Value) (string, error)
// Human-readable name of the writer, usually the output format.
Name() string
}
Writers take environment values and create a string (usually to be written to a file) of a given format.