Skip to content

Commit

Permalink
Add overviews to the examples (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecsammon authored May 7, 2024
1 parent c78593e commit c6cf0d9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions example_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
paddle "github.com/PaddleHQ/paddle-go-sdk"
)

// Demonstrates how to create a new entity.
func Example_create() {
// Create a mock HTTP server for this example - skip over this bit!
s := mockServerForExample(mockServerResponse{stub: &stub{paths: []stubPath{transaction}}})
Expand Down
1 change: 1 addition & 0 deletions example_get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
paddle "github.com/PaddleHQ/paddle-go-sdk"
)

// Demonstrates how to get an existing entity.
func Example_get() {
// Create a mock HTTP server for this example - skip over this bit!
s := mockServerForExample(mockServerResponse{stub: &stub{paths: []stubPath{transaction}}})
Expand Down
4 changes: 3 additions & 1 deletion example_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
paddle "github.com/PaddleHQ/paddle-go-sdk"
)

// Demonstrates how to fetch a list and iterate over the provided results.
func Example_list() {
// Create a mock HTTP server for this example - skip over this bit!
s := mockServerForExample(mockServerResponse{stub: &stub{paths: []stubPath{transactions}}})
Expand Down Expand Up @@ -46,7 +47,8 @@ func Example_list() {
//<nil>
}

func Example_list_paginate() {
// Demonstrates how to fetch a list and iterate over the provided results, including the automatic pagination.
func Example_pagination() {
// Create a mock HTTP server for this example - skip over this bit!
s := mockServerForExample(mockServerResponse{stub: &stub{paths: []stubPath{
transactionsPaginatedPg1,
Expand Down
1 change: 1 addition & 0 deletions example_update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
paddle "github.com/PaddleHQ/paddle-go-sdk"
)

// Demonstrates how to update an existing entity.
func Example_update() {
// Create a mock HTTP server for this example - skip over this bit!
s := mockServerForExample(mockServerResponse{stub: &stub{paths: []stubPath{transaction}}})
Expand Down
2 changes: 2 additions & 0 deletions example_webhook_verifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const (
exampleSecretKey = `pdl_ntfset_01hsdn8d43dt7mezr1ef2jtbaw_hKkRiCGyyRhbFwIUuqiTBgI7gnWoV0Gr`
)

// Demonstrates how to verify a webhook.
func ExampleWebhookVerifier_Verify() {
// Create a WebhookVerifier with your secret key
// You should keep your secret outside the src, e.g. as an env variable
Expand Down Expand Up @@ -82,6 +83,7 @@ func ExampleWebhookVerifier_Verify() {
// Output: {"success": true} <nil>
}

// Demonstrates how to use the WebhookVerifier as a middleware.
func ExampleWebhookVerifier_Middleware() {
// Create a WebhookVerifier with your secret key
// You should keep your secret outside the src, e.g. as an env variable
Expand Down

0 comments on commit c6cf0d9

Please sign in to comment.