Skip to content

Commit

Permalink
improve document for the xrayaws package
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo82148 committed Sep 8, 2023
1 parent 91434d5 commit 30ef470
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.
2 changes: 2 additions & 0 deletions xray/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package xray provides a simple API for tracing and monitoring AWS X-Ray.
package xray
11 changes: 11 additions & 0 deletions xrayaws-v2/doc.go
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion xrayaws-v2/whitelist/whitelist.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package whitelist provides whitelist of parameters for aws api.
package whitelist

import (
Expand All @@ -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"`
Expand Down
9 changes: 9 additions & 0 deletions xrayaws/doc.go
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion xrayaws/whitelist/whitelist.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package whitelist provides the whitelist of parameters for aws api.
package whitelist

import (
Expand All @@ -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"`
Expand Down

0 comments on commit 30ef470

Please sign in to comment.