Skip to content

Commit e3922df

Browse files
(DOCSP-23159) Add Go Tabs (#1344)
* add create index step to go app * add go tabs * build errors * build error * if - suggestion * update readme * langs > project
1 parent 0ae68aa commit e3922df

File tree

31 files changed

+708
-23
lines changed

31 files changed

+708
-23
lines changed

source/core/queryable-encryption/quick-start.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ Before You Get Started
6969

7070
`Complete Java Application <{+sample-app-url-qe+}java-fle-2/local/reader/>`__
7171

72+
.. tab:: Go
73+
:tabid: go
74+
75+
`Complete Go Application <{+sample-app-url-qe+}go-fle-2/local/reader/>`__
76+
7277

7378
.. tabs-selector:: drivers
7479

@@ -112,6 +117,12 @@ Procedure
112117
To view the complete code for making a {+dek-long+}, see
113118
`our Github repository <{+sample-app-url-qe+}java-fle-2/local/reader/src/main/java/com/mongodb/csfle/makeDataKey.java>`__.
114119

120+
.. tab::
121+
:tabid: go
122+
123+
To view the complete code for making a {+dek-long+}, see
124+
`our Github repository <{+sample-app-url-qe+}go-fle-2/local/reader/make-data-key.go>`__.
125+
115126

116127
.. step:: Configure your MongoClient for Encrypted Reads and Writes
117128

@@ -143,6 +154,12 @@ Procedure
143154
To view the complete code for inserting an encrypted document, see
144155
`our Github repository <{+sample-app-url-qe+}java-fle-2/local/reader/src/main/java/com/mongodb/csfle/insertEncryptedDocument.java>`__.
145156

157+
.. tab::
158+
:tabid: go
159+
160+
To view the complete code for inserting an encrypted document, see
161+
`our Github repository <{+sample-app-url-qe+}go-fle-2/local/reader/insert-encrypted-document.go>`__.
162+
146163

147164
.. step:: Retrieve Your Encrypted Document
148165

@@ -170,6 +187,13 @@ Procedure
170187
To view the complete code for finding an encrypted document, see
171188
`our Github repository <{+sample-app-url-qe+}java-fle-2/local/reader/src/main/java/com/mongodb/csfle/insertEncryptedDocument.java>`__.
172189

190+
.. tab::
191+
:tabid: go
192+
193+
To view the complete code for finding an encrypted document, see
194+
`our Github repository <{+sample-app-url-qe+}go-fle-2/local/reader/insert-encrypted-document.go>`__.
195+
196+
173197
Learn More
174198
----------
175199

source/core/queryable-encryption/tutorials/aws/aws-automatic.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ Before You Get Started
5252

5353
`Complete Java Application <{+sample-app-url-qe+}java-fle-2/aws/reader/>`__
5454

55+
.. tab:: Go
56+
:tabid: go
57+
58+
`Complete Go Application <{+sample-app-url-qe+}go-fle-2/aws/reader/>`__
59+
5560

5661
.. tabs-selector:: drivers
5762

@@ -106,6 +111,12 @@ Create the Application
106111
To view the complete code for making a {+dek-long+}, see
107112
`our Github repository <{+sample-app-url-qe+}java-fle-2/aws/reader/src/main/java/com/mongodb/csfle/makeDataKey.java>`__.
108113

114+
.. tab::
115+
:tabid: go
116+
117+
To view the complete code for making a {+dek-long+}, see
118+
`our Github repository <{+sample-app-url-qe+}go-fle-2/aws/reader/make-data-key.go>`__.
119+
109120

110121
.. step:: Configure your MongoClient for Encrypted Reads and Writes
111122

@@ -137,6 +148,13 @@ Create the Application
137148
To view the complete code for inserting an encrypted document, see
138149
`our Github repository <{+sample-app-url-qe+}java-fle-2/aws/reader/src/main/java/com/mongodb/csfle/insertEncryptedDocument.java>`__.
139150

151+
.. tab::
152+
:tabid: go
153+
154+
To view the complete code for inserting an encrypted document, see
155+
`our Github repository <{+sample-app-url-qe+}go-fle-2/aws/reader/insert-encrypted-document.go>`__.
156+
157+
140158
.. step:: Retrieve Your Encrypted Document
141159

142160
.. include:: /includes/queryable-encryption/tutorials/automatic/aws/find.rst
@@ -163,6 +181,13 @@ Create the Application
163181
To view the complete code for finding an encrypted document, see
164182
`our Github repository <{+sample-app-url-qe+}java-fle-2/aws/reader/src/main/java/com/mongodb/csfle/insertEncryptedDocument.java>`__.
165183

184+
.. tab::
185+
:tabid: go
186+
187+
To view the complete code for finding an encrypted document, see
188+
`our Github repository <{+sample-app-url-qe+}go-fle-2/aws/reader/insert-encrypted-document.go>`__.
189+
190+
166191

167192
Learn More
168193
----------

source/core/queryable-encryption/tutorials/azure/azure-automatic.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ Before You Get Started
5252

5353
`Complete Java Application <{+sample-app-url-qe+}java-fle-2/azure/reader/>`__
5454

55+
.. tab:: Go
56+
:tabid: go
57+
58+
`Complete Go Application <{+sample-app-url-qe+}go-fle-2/azure/reader/>`__
59+
60+
5561
.. tabs-selector:: drivers
5662

5763
Set Up the KMS
@@ -104,6 +110,13 @@ Create the Application
104110
To view the complete code for making a {+dek-long+}, see
105111
`our Github repository <{+sample-app-url-qe+}java-fle-2/azure/reader/src/main/java/com/mongodb/csfle/makeDataKey.java>`__.
106112

113+
.. tab::
114+
:tabid: go
115+
116+
To view the complete code for making a {+dek-long+}, see
117+
`our Github repository <{+sample-app-url-qe+}go-fle-2/azure/reader/make-data-key.go>`__.
118+
119+
107120
.. step:: Configure your MongoClient for Encrypted Reads and Writes
108121

109122
.. include:: /includes/queryable-encryption/tutorials/automatic/azure/client.rst
@@ -134,6 +147,13 @@ Create the Application
134147
To view the complete code for inserting an encrypted document, see
135148
`our Github repository <{+sample-app-url-qe+}java-fle-2/azure/reader/src/main/java/com/mongodb/csfle/insertEncryptedDocument.java>`__.
136149

150+
.. tab::
151+
:tabid: go
152+
153+
To view the complete code for inserting an encrypted document, see
154+
`our Github repository <{+sample-app-url-qe+}go-fle-2/azure/reader/insert-encrypted-document.go>`__.
155+
156+
137157
.. step:: Retrieve Your Encrypted Document
138158

139159
.. include:: /includes/queryable-encryption/tutorials/automatic/azure/find.rst
@@ -160,6 +180,13 @@ Create the Application
160180
To view the complete code for finding an encrypted document, see
161181
`our Github repository <{+sample-app-url-qe+}java-fle-2/azure/reader/src/main/java/com/mongodb/csfle/insertEncryptedDocument.java>`__.
162182

183+
.. tab::
184+
:tabid: go
185+
186+
To view the complete code for finding an encrypted document, see
187+
`our Github repository <{+sample-app-url-qe+}go-fle-2/azure/reader/insert-encrypted-document.go>`__.
188+
189+
163190
Learn More
164191
----------
165192

source/core/queryable-encryption/tutorials/gcp/gcp-automatic.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ Before You Get Started
5151

5252
`Complete Java Application <{+sample-app-url-qe+}java-fle-2/gcp/reader/>`__
5353

54+
.. tab:: Go
55+
:tabid: go
56+
57+
`Complete Go Application <{+sample-app-url-qe+}go-fle-2/gcp/reader/>`__
58+
59+
5460
.. tabs-selector:: drivers
5561

5662
Set Up the KMS
@@ -107,6 +113,13 @@ your application to see relevant code samples.
107113
To view the complete code for making a {+dek-long+}, see
108114
`our Github repository <{+sample-app-url-qe+}java-fle-2/gcp/reader/src/main/java/com/mongodb/csfle/makeDataKey.java>`__.
109115

116+
.. tab::
117+
:tabid: go
118+
119+
To view the complete code for making a {+dek-long+}, see
120+
`our Github repository <{+sample-app-url-qe+}go-fle-2/gcp/reader/make-data-key.go>`__.
121+
122+
110123
.. step:: Configure your MongoClient for Encrypted Reads and Writes
111124

112125
.. include:: /includes/queryable-encryption/tutorials/automatic/gcp/client.rst
@@ -137,6 +150,13 @@ your application to see relevant code samples.
137150
To view the complete code for inserting an encrypted document, see
138151
`our Github repository <{+sample-app-url-qe+}java-fle-2/gcp/reader/src/main/java/com/mongodb/csfle/insertEncryptedDocument.java>`__.
139152

153+
.. tab::
154+
:tabid: go
155+
156+
To view the complete code for inserting an encrypted document, see
157+
`our Github repository <{+sample-app-url-qe+}go-fle-2/gcp/reader/insert-encrypted-document.go>`__.
158+
159+
140160
.. step:: Retrieve Your Encrypted Document
141161

142162
.. include:: /includes/queryable-encryption/tutorials/automatic/gcp/find.rst
@@ -163,6 +183,12 @@ your application to see relevant code samples.
163183
To view the complete code for finding an encrypted document, see
164184
`our Github repository <{+sample-app-url-qe+}java-fle-2/gcp/reader/src/main/java/com/mongodb/csfle/insertEncryptedDocument.java>`__.
165185

186+
.. tab::
187+
:tabid: go
188+
189+
To view the complete code for finding an encrypted document, see
190+
`our Github repository <{+sample-app-url-qe+}go-fle-2/gcp/reader/insert_encrypted_document.go>`__.
191+
166192

167193
Learn More
168194
----------

source/includes/queryable-encryption/quick-start/client.rst

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@
4040
:dedent:
4141
:caption: insertEncryptedDocument.java
4242

43+
.. tab::
44+
:tabid: go
45+
46+
.. literalinclude:: /includes/sample_apps/csfle/build/go-fle-2/local/reader/insert-encrypted-document.go
47+
:start-after: start-key-vault
48+
:end-before: end-key-vault
49+
:language: go
50+
:dedent:
51+
:caption: insert-encrypted-document.go
4352

4453
.. step:: Specify the Local {+cmk-long+}
4554

@@ -77,6 +86,15 @@
7786
:dedent:
7887
:caption: insertEncryptedDocument.java
7988

89+
.. tab::
90+
:tabid: go
91+
92+
.. literalinclude:: /includes/sample_apps/csfle/build/go-fle-2/local/reader/insert-encrypted-document.go
93+
:start-after: start-kmsproviders
94+
:end-before: end-kmsproviders
95+
:language: go
96+
:dedent:
97+
:caption: insert-encrypted-document.go
8098

8199
.. step:: Create an {+enc-fields-map-title+} For Your Collection
82100

@@ -114,6 +132,16 @@
114132
:dedent:
115133
:caption: insertEncryptedDocument.java
116134

135+
.. tab::
136+
:tabid: go
137+
138+
.. literalinclude:: /includes/sample_apps/csfle/build/go-fle-2/local/reader/insert-encrypted-document.go
139+
:start-after: start-schema
140+
:end-before: end-schema
141+
:language: go
142+
:dedent:
143+
:caption: insert-encrypted-document.go
144+
117145
.. step:: Specify the Location of the {+shared-library+}
118146

119147
.. _qe-quick-start-shared-lib:
@@ -150,6 +178,16 @@
150178
:dedent:
151179
:caption: insertEncryptedDocument.java
152180

181+
.. tab::
182+
:tabid: go
183+
184+
.. literalinclude:: /includes/sample_apps/csfle/build/go-fle-2/local/reader/insert-encrypted-document.go
185+
:start-after: start-extra-options
186+
:end-before: end-extra-options
187+
:language: go
188+
:dedent:
189+
:caption: insert-encrypted-document.go
190+
153191
.. include:: /includes/queryable-encryption/shared-lib-learn-more.rst
154192

155193
.. step:: Create the MongoClient
@@ -188,3 +226,13 @@
188226
:language: java
189227
:dedent:
190228
:caption: insertEncryptedDocument.java
229+
230+
.. tab::
231+
:tabid: go
232+
233+
.. literalinclude:: /includes/sample_apps/csfle/build/go-fle-2/local/reader/insert-encrypted-document.go
234+
:start-after: start-client
235+
:end-before: end-client
236+
:language: go
237+
:dedent:
238+
:caption: insert-encrypted-document.go

source/includes/queryable-encryption/quick-start/dek.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@
4747
:dedent:
4848
:caption: makeDataKey.java
4949

50+
.. tab::
51+
:tabid: go
52+
53+
.. literalinclude:: /includes/sample_apps/csfle/build/go-fle-2/local/reader/make-data-key.go
54+
:start-after: start-kmsproviders
55+
:end-before: end-kmsproviders
56+
:language: go
57+
:dedent:
58+
:caption: insert-encrypted-document.go
59+
5060
.. step:: Create your {+dek-long+}s
5161

5262
.. _qe-local-create-dek:
@@ -95,6 +105,16 @@
95105
:dedent:
96106
:caption: makeDataKey.java
97107

108+
.. tab::
109+
:tabid: go
110+
111+
.. literalinclude:: /includes/sample_apps/csfle/build/go-fle-2/local/reader/make-data-key.go
112+
:start-after: start-create-dek
113+
:end-before: end-create-dek
114+
:language: go
115+
:dedent:
116+
:caption: insert-encrypted-document.go
117+
98118
.. step:: Create Your Encrypted Collection
99119

100120
Use a {+qe+} enabled ``MongoClient`` instance to specify what
@@ -132,6 +152,16 @@
132152
:dedent:
133153
:caption: makeDataKey.java
134154

155+
.. tab::
156+
:tabid: go
157+
158+
.. literalinclude:: /includes/sample_apps/csfle/build/go-fle-2/local/reader/make-data-key.go
159+
:start-after: start-create-enc-collection
160+
:end-before: end-create-enc-collection
161+
:language: go
162+
:dedent:
163+
:caption: insert-encrypted-document.go
164+
135165
The output from the code in this section should resemble the following:
136166

137167
.. literalinclude:: /includes/queryable-encryption/quick-start/dek-output.out

source/includes/queryable-encryption/quick-start/find.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ a client that is not configured for automatic {+qe+}.
3838
:dedent:
3939
:caption: insertEncryptedDocument.java
4040

41+
.. tab::
42+
:tabid: go
43+
44+
.. literalinclude:: /includes/sample_apps/csfle/build/go-fle-2/local/reader/insert-encrypted-document.go
45+
:start-after: start-find
46+
:end-before: end-find
47+
:language: go
48+
:dedent:
49+
:caption: insert-encrypted-document.go
50+
4151
The output of the preceding code snippet should look like this:
4252

4353
.. literalinclude:: /includes/queryable-encryption/quick-start/find-output.out

source/includes/queryable-encryption/quick-start/insert.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ snippet:
3737
:dedent:
3838
:caption: insertEncryptedDocument.java
3939

40+
.. tab::
41+
:tabid: go
42+
43+
.. literalinclude:: /includes/sample_apps/csfle/build/go-fle-2/local/reader/insert-encrypted-document.go
44+
:start-after: start-insert
45+
:end-before: end-insert
46+
:language: go
47+
:dedent:
48+
:caption: insert-encrypted-document.go
49+
4050
When you insert a document, your {+qe+} enabled client
4151
encrypts the fields of your document such that it resembles the following:
4252

source/includes/queryable-encryption/quick-start/key-vault-index.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,13 @@ Create a unique index on the ``keyAltNames`` field in your
3434
:language: java
3535
:dedent:
3636
:caption: makeDataKey.java
37+
38+
.. tab::
39+
:tabid: go
40+
41+
.. literalinclude:: /includes/sample_apps/csfle/build/go-fle-2/local/reader/make-data-key.go
42+
:start-after: start-create-index
43+
:end-before: end-create-index
44+
:language: go
45+
:dedent:
46+
:caption: insert-encrypted-document.go

0 commit comments

Comments
 (0)