()
| 46 | } |
| 47 | |
| 48 | func Example_openVariableFromURL() { |
| 49 | // PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored. |
| 50 | // PRAGMA: On gocloud.dev, add a blank import: _ "gocloud.dev/runtimevar/awssecretsmanager" |
| 51 | // PRAGMA: On gocloud.dev, hide lines until the next blank line. |
| 52 | ctx := context.Background() |
| 53 | |
| 54 | // runtimevar.OpenVariable creates a *runtimevar.Variable from a URL. |
| 55 | // `secret-variable-name` must be a friendly name of the secret, NOT the Amazon Resource Name (ARN). |
| 56 | v, err := runtimevar.OpenVariable(ctx, "awssecretsmanager://secret-variable-name?region=us-east-2&decoder=string") |
| 57 | if err != nil { |
| 58 | log.Fatal(err) |
| 59 | } |
| 60 | defer v.Close() |
| 61 | } |
nothing calls this directly
no test coverage detected