Skip to content

Commit

Permalink
#149 Initial go notbook
Browse files Browse the repository at this point in the history
  • Loading branch information
docktermj committed Dec 9, 2024
1 parent 0788ea7 commit f6ce35e
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions rootfs/examples/notebooks/go/senzing_hello_world.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "0075446b-249d-428d-badc-2f75a2a5d78b",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{\"PRODUCT_NAME\":\"Senzing API\",\"VERSION\":\"4.0.0\",\"BUILD_VERSION\":\"4.0.0.24330\",\"BUILD_DATE\":\"2024-11-25\",\"BUILD_NUMBER\":\"2024_11_25__12_49\",\"COMPATIBILITY_VERSION\":{\"CONFIG_VERSION\":\"11\"},\"SCHEMA_VERSION\":{\"ENGINE_SCHEMA_VERSION\":\"4.0\",\"MINIMUM_REQUIRED_SCHEMA_VERSION\":\"4.0\",\"MAXIMUM_REQUIRED_SCHEMA_VERSION\":\"4.99\"}}\n"
]
}
],
"source": [
"import (\n",
"\t\"google.golang.org/grpc\"\n",
"\t\"google.golang.org/grpc/credentials/insecure\"\n",
" \"github.com/senzing-garage/sz-sdk-go-grpc/szabstractfactory\"\n",
")\n",
"\n",
"var (\n",
"\tgrpcAddress = \"localhost:8261\"\n",
"\n",
")\n",
"\n",
"%% \n",
"grpcConnection, err := grpc.NewClient(grpcAddress, grpc.WithTransportCredentials(insecure.NewCredentials()))\n",
"if err != nil {\n",
"\tpanic(err)\n",
"}\n",
"\n",
"szAbstractFactory := &szabstractfactory.Szabstractfactory{\n",
"\tGrpcConnection: grpcConnection,\n",
"}\n",
"\n",
"ctx := context.TODO()\n",
"szProduct, err := szAbstractFactory.CreateSzProduct(ctx)\n",
"\n",
"version, err := szProduct.GetVersion(ctx)\n",
"fmt.Println(version)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "8aebcd0c-baa7-45f2-bc4d-6a7bd2b303ba",
"metadata": {},
"outputs": [],
"source": [
"%%\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Go (gonb)",
"language": "go",
"name": "gonb"
},
"language_info": {
"codemirror_mode": "",
"file_extension": ".go",
"mimetype": "",
"name": "go",
"nbconvert_exporter": "",
"pygments_lexer": "",
"version": "go1.23.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

0 comments on commit f6ce35e

Please sign in to comment.