secretfiles

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: GPL-3.0 Imports: 4 Imported by: 1

README

secretfiles

import "github.com/greenbone/opensight-golang-libraries/pkg/secretfiles"

Package secretfiles eases the parsing of secret files into a string. This is a common scenario when working with docker secrets, where the path to the secret is usually stored in an environment variable <SECRET>_FILE containing a path to a secret stored in the container filesystem.

Index

func ReadSecret

func ReadSecret(envVar string, target *string) error

ReadSecret reads the file path from the given environment variable and writes the content of this file into the target. Surrounding whitespaces are truncated.

Generated by gomarkdoc

Documentation

Overview

Package secretfiles eases the parsing of secret files into a string. This is a common scenario when working with docker secrets, where the path to the secret is usually stored in an environment variable <SECRET>_FILE containing a path to a secret stored in the container filesystem.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadSecret

func ReadSecret(envVar string, target *string) error

ReadSecret reads the file path from the given environment variable and writes the content of this file into the target. Surrounding whitespaces are truncated.

Types

This section is empty.

Jump to

Keyboard shortcuts

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