Skip to content

Commit

Permalink
fix: use idiomatic comment syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
matoous committed Sep 22, 2023
1 parent 44434a7 commit 186afa2
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 21 deletions.
1 change: 1 addition & 0 deletions api_keys.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions authorization.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions checkouts.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 19 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
// Package sumup provides a client for using the SumUp API.
// Usage:
//
// import "github.com/sumup/sumup-go"
//
// Construct a new SumUp client, then use the various services on the client to
// access different parts of the SumUp API. For example:
//
// client := sumup.NewClient().WithAuth(os.Getenv("SUMUP_KEY"))
//
// // get the account the client is currently authorized for
// account, err := client.Merchant.Get(context.Background(), sumup.GetAccountParams{})
//
// The client is structured around individual services that correspond to the tags
// in SumUp documentation https://developer.sumup.com/docs/api/sum-up-rest-api/.
package sumup

import (
Expand All @@ -23,6 +38,7 @@ type service struct {
client *Client
}

// Client manages communication with the SumUp APIs.
type Client struct {
// service is the shared service struct re-used for all services.
svc service
Expand All @@ -48,7 +64,7 @@ type Client struct {
Transactions *TransactionsService
}

// NewClient creates new SumUp API client.
// NewClient creates new SumUp API [Client].
// To use APIs that require authentication use [Client.WithAuth].
func NewClient() *Client {
c := &Client{
Expand All @@ -60,7 +76,7 @@ func NewClient() *Client {
return c
}

// WithAuth returns a copy of the client configured with the provided Authorization key.
// WithAuth returns a copy of the [Client] configured with the provided Authorization key.
func (c *Client) WithAuth(key string) *Client {
clone := Client{
client: c.client,
Expand All @@ -72,7 +88,7 @@ func (c *Client) WithAuth(key string) *Client {
return &clone
}

// WithClient returns a copy of the client configured with the provided http client.
// WithClient returns a copy of the [Client] configured with the provided http client.
func (c *Client) WithHTTPClient(client *http.Client) *Client {
clone := Client{
client: client,
Expand Down
1 change: 1 addition & 0 deletions customers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 0 additions & 18 deletions doc.go

This file was deleted.

1 change: 1 addition & 0 deletions merchant.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions payouts.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions receipts.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions subaccounts.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions transactions.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 186afa2

Please sign in to comment.