Documentation ¶
Overview ¶
Package secrets give access to Google Secret Manager secrets easily and keeping the values updated.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Read ¶
Read a secret and return its value. Multiple reads of the same secret will return a cached version.
Types ¶
type ChangeHook ¶
type ChangeHook func(val *Value)
ChangeHook is a function called when a secret changes.
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value is a secret accesor that will keep its own value updated in background. When read it will return the latest available version of the secret.
func NewStaticValue ¶ added in v1.97.0
NewStaticValue creates a value from a static string that never updates.
func NewStaticValueBytes ¶ added in v1.97.0
NewStaticValue creates a value from a static byte slice that never updates.
func NewStaticValueJSON ¶ added in v1.97.0
NewStaticValue creates a value from a static JSON serialized struct that never updates.
func (*Value) OnChange ¶
func (val *Value) OnChange(hook ChangeHook)
OnChange registers a hook to be called when a value change is detected. In the hook you can update clients or other actions the application needs.