Documentation
¶
Index ¶
- Constants
- func DeleteOutput(name string) error
- func DeleteSecret(name string) error
- func FormatKeyValue(key, value, ext string) string
- func ParseKeyValue(line, ext string) (string, string)
- func ReadLines(filename string) ([]string, error)
- func SetErrorMetadata(message, code, category string) error
- func SetOutput(name, value string) error
- func SetSecret(name, value string) error
- func UpdateOrRemoveKeyValue(envVar, key, newValue string, deleteKey bool) error
- func UpdateOutput(name, value string) error
- func UpdateSecret(name, value string) error
- func WriteLines(filename string, lines []string) error
Constants ¶
const ( // ErrorMessageKey is the key used to retrieve or store the error message content. ErrorMessageKey = "ERROR_MESSAGE" // ErrorCodeKey is the key used to identify the specific error code associated with an error. ErrorCodeKey = "ERROR_CODE" // ErrorCategoryKey is the key used to classify the category of the error, which can help in grouping similar types of errors. ErrorCategoryKey = "ERROR_CATEGORY" // MetadataFile is the key for the file that stores metadata associated with an error, such as details about the error's source or context. MetadataFile = "ERROR_METADATA_FILE" // DroneOutputFile is the key for the file where outputs can be exported and utilized in the subsequent steps in Harness CI pipeline. DroneOutputFile = "DRONE_OUTPUT" // HarnessOutputSecretFile is the key for the file where secrets can be exported and utilized in the subsequent steps in Harness CI pipeline. HarnessOutputSecretFile = "HARNESS_OUTPUT_SECRET_FILE" )
Variables ¶
This section is empty.
Functions ¶
func DeleteOutput ¶ added in v1.0.6
DeleteOutput removes an output from the file entirely.
func DeleteSecret ¶
DeleteSecret removes a secret from the file entirely.
func FormatKeyValue ¶ added in v1.0.7
FormatKeyValue handles formatting for .env and .out files.
func ParseKeyValue ¶ added in v1.0.7
ParseKeyValue parses a key-value pair from a string and returns the key and value.
func ReadLines ¶ added in v1.0.7
ReadLines reads lines from a file and returns them as a slice of strings.
func SetErrorMetadata ¶ added in v1.0.7
SetErrorMetadata sets the error message, error code, and error category, writing them to the CI_ERROR_METADATA file
func UpdateOrRemoveKeyValue ¶ added in v1.0.7
UpdateOrRemoveKeyValue updates or deletes a key-value pair in the specified file.
func UpdateOutput ¶ added in v1.0.6
UpdateOutput overwrites the value of an existing output.
func UpdateSecret ¶
UpdateSecret overwrites the value of an existing secret.
func WriteLines ¶ added in v1.0.7
WriteLines writes a slice of strings to a file, each string being written to a new line.
Types ¶
This section is empty.