MCPcopy Index your code
hub / github.com/perkeep/perkeep / ExplicitSecretRingFile

Function ExplicitSecretRingFile

internal/osutil/paths.go:249–260  ·  view source on GitHub ↗

ExplicitSecretRingFile returns the path to the user's GPG secret ring file and true if it was ever set through the --secret-keyring flag or the CAMLI_SECRET_RING var. It returns "", false otherwise. Use of this function requires the program to call AddSecretRingFlag, and before flag.Parse is called.

()

Source from the content-addressed store, hash-verified

247// Use of this function requires the program to call AddSecretRingFlag,
248// and before flag.Parse is called.
249func ExplicitSecretRingFile() (string, bool) {
250 if !secretRingFlagAdded {
251 panic("proper use of ExplicitSecretRingFile requires exposing flagSecretRing with AddSecretRingFlag")
252 }
253 if flagSecretRing != "" {
254 return flagSecretRing, true
255 }
256 if e := os.Getenv("CAMLI_SECRET_RING"); e != "" {
257 return e, true
258 }
259 return "", false
260}
261
262// DefaultSecretRingFile returns the path to the default GPG secret
263// keyring. It is not influenced by any flag or CAMLI* env var.

Callers 2

SecretRingFileMethod · 0.92
initSecretRingMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected