creds

package
v1.9.13 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2025 License: MIT Imports: 9 Imported by: 0

README

Credentials

This module allows you to get variables:

  • from custom storage (ex. config file)
  • from credential files
  • from environment variables

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSecret

func AddSecret(value string)

func GetValue

func GetValue(name string) (value string, ok bool)

func ReplaceVars

func ReplaceVars(data []byte) []byte

ReplaceVars - support format ${CAMERA_PASSWORD} and ${RTSP_USER:admin}

func SecretResponse

func SecretResponse(w http.ResponseWriter) http.ResponseWriter

func SecretString

func SecretString(s string) string

func SecretWriter

func SecretWriter(w io.Writer) io.Writer

func SetStorage

func SetStorage(s Storage)

func SetValue

func SetValue(name, value string) error

Types

type Storage

type Storage interface {
	SetValue(name, value string) error
	GetValue(name string) (string, bool)
}

Jump to

Keyboard shortcuts

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