MCPcopy Create free account
hub / github.com/google/go-cloud / ExampleKeeper_Encrypt

Function ExampleKeeper_Encrypt

secrets/example_test.go:83–97  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

81}
82
83func ExampleKeeper_Encrypt() {
84 // PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored.
85 // PRAGMA: On gocloud.dev, hide lines until the next blank line.
86 ctx := context.Background()
87 var keeper *secrets.Keeper
88
89 plainText := []byte("Secrets secrets...")
90 cipherText, err := keeper.Encrypt(ctx, plainText)
91 if err != nil {
92 log.Fatal(err)
93 }
94
95 // PRAGMA: On gocloud.dev, hide the rest of the function.
96 _ = cipherText
97}
98
99func ExampleKeeper_Decrypt() {
100 // PRAGMA: This example is used on gocloud.dev; PRAGMA comments adjust how it is shown and can be ignored.

Callers

nothing calls this directly

Calls 1

EncryptMethod · 0.95

Tested by

no test coverage detected