From 30ef47034f2b8053dcb53991392217eb80106c2f Mon Sep 17 00:00:00 2001 From: ICHINOSE Shogo Date: Fri, 8 Sep 2023 11:08:51 +0900 Subject: [PATCH] improve document for the xrayaws package --- xray/doc.go | 2 ++ xrayaws-v2/doc.go | 11 +++++++++++ xrayaws-v2/whitelist/whitelist.go | 3 ++- xrayaws/doc.go | 9 +++++++++ xrayaws/whitelist/whitelist.go | 3 ++- 5 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 xray/doc.go create mode 100644 xrayaws-v2/doc.go create mode 100644 xrayaws/doc.go diff --git a/xray/doc.go b/xray/doc.go new file mode 100644 index 0000000..dfb770f --- /dev/null +++ b/xray/doc.go @@ -0,0 +1,2 @@ +// Package xray provides a simple API for tracing and monitoring AWS X-Ray. +package xray diff --git a/xrayaws-v2/doc.go b/xrayaws-v2/doc.go new file mode 100644 index 0000000..9cb4fd2 --- /dev/null +++ b/xrayaws-v2/doc.go @@ -0,0 +1,11 @@ +// Package xrayaws provides AWS X-Ray tracing for AWS SDK for Go v2. +// +// cfg, err := config.LoadDefaultConfig(ctx, xrayaws.WithXRay()) +// if err != nil { +// panic(err) +// } +// svc := dynamodb.NewFromConfig(cfg) +// +// // the following requests are traced. +// dynamo.ListTables(ctx, &dynamodb.ListTablesInput{}) +package xrayaws diff --git a/xrayaws-v2/whitelist/whitelist.go b/xrayaws-v2/whitelist/whitelist.go index bac035b..cec9d7c 100644 --- a/xrayaws-v2/whitelist/whitelist.go +++ b/xrayaws-v2/whitelist/whitelist.go @@ -1,3 +1,4 @@ +// Package whitelist provides whitelist of parameters for aws api. package whitelist import ( @@ -24,7 +25,7 @@ type Operation struct { ResponseParameters []string `json:"response_parameters,omitempty"` } -// Descriptor is a rule for recording the paremeter. +// Descriptor is a rule for recording the parameter. type Descriptor struct { Map bool `json:"map,omitempty"` GetKeys bool `json:"get_keys"` diff --git a/xrayaws/doc.go b/xrayaws/doc.go new file mode 100644 index 0000000..4b98406 --- /dev/null +++ b/xrayaws/doc.go @@ -0,0 +1,9 @@ +// Package xrayaws traces AWS SDK Go requests using AWS X-Ray. +// +// sess := session.Must(session.NewSession()) +// svc := dynamodb.New(sess) +// xrayaws.Client(svc.Client) // install AWS X-Ray tracer +// +// // the following requests are traced. +// dynamo.ListTablesWithContext(ctx, &dynamodb.ListTablesInput{}) +package xrayaws diff --git a/xrayaws/whitelist/whitelist.go b/xrayaws/whitelist/whitelist.go index bac035b..9955635 100644 --- a/xrayaws/whitelist/whitelist.go +++ b/xrayaws/whitelist/whitelist.go @@ -1,3 +1,4 @@ +// Package whitelist provides the whitelist of parameters for aws api. package whitelist import ( @@ -24,7 +25,7 @@ type Operation struct { ResponseParameters []string `json:"response_parameters,omitempty"` } -// Descriptor is a rule for recording the paremeter. +// Descriptor is a rule for recording the parameter. type Descriptor struct { Map bool `json:"map,omitempty"` GetKeys bool `json:"get_keys"`