Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/apitoolkit/apitoolkit-go in…
Browse files Browse the repository at this point in the history
…to Refactor_Codebase
  • Loading branch information
dawkaka committed Jul 10, 2024
2 parents f0e9a45 + 64c78c9 commit 2d9224a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

## Golang SDK

[![APItoolkit SDK](https://img.shields.io/badge/APItoolkit-SDK-0068ff?logo=go)](https://github.com/topics/apitoolkit-sdk) [![Join Discord Server](https://img.shields.io/badge/Chat-Discord-7289da)](https://discord.gg/dEB6EjQnKB) [![APItoolkit Docs](https://img.shields.io/badge/Read-Docs-0068ff)](https://apitoolkit.io/docs/sdks/golang?utm_source=github-sdks) [![GoDoc](https://godoc.org/github.com/apitoolkit/apitoolkit-go?status.svg)](https://godoc.org/github.com/apitoolkit/apitoolkit-go)
[![APItoolkit SDK](https://img.shields.io/badge/APItoolkit-SDK-0068ff?logo=go)](https://github.com/topics/apitoolkit-sdk) [![Join Discord Server](https://img.shields.io/badge/Chat-Discord-7289da)](https://apitoolkit.io/discord?utm_campaign=devrel&utm_medium=github&utm_source=sdks_readme) [![APItoolkit Docs](https://img.shields.io/badge/Read-Docs-0068ff)](https://apitoolkit.io/docs/sdks/golang?utm_campaign=devrel&utm_medium=github&utm_source=sdks_readme) [![GoDoc](https://godoc.org/github.com/apitoolkit/apitoolkit-go?status.svg)](https://godoc.org/github.com/apitoolkit/apitoolkit-go)

APItoolkit is an end-to-end API and web services management toolkit for engineers and customer support teams. To integrate your Golang application with APItoolkit, you need to use this SDK to monitor incoming traffic, aggregate the requests, and then deliver them to the APItoolkit's servers.

Expand Down Expand Up @@ -75,20 +75,20 @@ func main() {

> [!NOTE]
>
> - This SDK supports multiple Golang frameworks (including, [Chi](https://apitoolkit.io/docs/sdks/golang/chi?utm_source=github-sdks), [Echo](https://apitoolkit.io/docs/sdks/golang/echo?utm_source=github-sdks), [Fiber](https://apitoolkit.io/docs/sdks/golang/fiber?utm_source=github-sdks), [Gin](https://apitoolkit.io/docs/sdks/golang/gin?utm_source=github-sdks), [Gorilla Mux](https://apitoolkit.io/docs/sdks/golang/gorillamux?utm_source=github-sdks), and [Native](https://apitoolkit.io/docs/sdks/golang/native?utm_source=github-sdks)). You can learn how to configure each framework using the provided Middleware (e.g., `EchoMiddleware`) in the respective linked docs above.
> - The `{ENTER_YOUR_API_KEY_HERE}` demo string should be replaced with the [API key](https://apitoolkit.io/docs/dashboard/settings-pages/api-keys?utm_source=github-sdks) generated from the APItoolkit dashboard.
> - This SDK supports multiple Golang frameworks (including, [Chi](https://apitoolkit.io/docs/sdks/golang/chi?utm_campaign=devrel&utm_medium=github&utm_source=sdks_readme), [Echo](https://apitoolkit.io/docs/sdks/golang/echo?utm_campaign=devrel&utm_medium=github&utm_source=sdks_readme), [Fiber](https://apitoolkit.io/docs/sdks/golang/fiber?utm_campaign=devrel&utm_medium=github&utm_source=sdks_readme), [Gin](https://apitoolkit.io/docs/sdks/golang/gin?utm_campaign=devrel&utm_medium=github&utm_source=sdks_readme), [Gorilla Mux](https://apitoolkit.io/docs/sdks/golang/gorillamux?utm_campaign=devrel&utm_medium=github&utm_source=sdks_readme), and [Native](https://apitoolkit.io/docs/sdks/golang/native?utm_campaign=devrel&utm_medium=github&utm_source=sdks_readme)). You can learn how to configure each framework using the provided Middleware (e.g., `EchoMiddleware`) in the respective linked docs above.
> - The `{ENTER_YOUR_API_KEY_HERE}` demo string should be replaced with the [API key](https://apitoolkit.io/docs/dashboard/settings-pages/api-keys?utm_campaign=devrel&utm_medium=github&utm_source=sdks_readme) generated from the APItoolkit dashboard.
<br />

> [!IMPORTANT]
>
> To learn more configuration options (redacting fields, error reporting, outgoing requests, etc.), please read this [SDK documentation](https://apitoolkit.io/docs/sdks/golang?utm_source=github-sdks).
> To learn more configuration options (redacting fields, error reporting, outgoing requests, etc.), please read this [SDK documentation](https://apitoolkit.io/docs/sdks/golang?utm_campaign=devrel&utm_medium=github&utm_source=sdks_readme).
## Contributing and Help

To contribute to the development of this SDK or request help from the community and our team, kindly do any of the following:
- Read our [Contributors Guide](https://github.com/apitoolkit/.github/blob/main/CONTRIBUTING.md).
- Join our community [Discord Server](https://discord.gg/dEB6EjQnKB).
- Join our community [Discord Server](https://apitoolkit.io/discord?utm_campaign=devrel&utm_medium=github&utm_source=sdks_readme).
- Create a [new issue](https://github.com/apitoolkit/apitoolkit-go/issues/new/choose) in this repository.

## License
Expand All @@ -99,6 +99,6 @@ This repository is published under the [MIT](LICENSE) license.

<div align="center">

<a href="https://apitoolkit.io?utm_source=github-sdks" target="_blank" rel="noopener noreferrer"><img src="https://github.com/apitoolkit/.github/blob/main/images/icon.png?raw=true" width="40" /></a>
<a href="https://apitoolkit.io?utm_campaign=devrel&utm_medium=github&utm_source=sdks_readme" target="_blank" rel="noopener noreferrer"><img src="https://github.com/apitoolkit/.github/blob/main/images/icon.png?raw=true" width="40" /></a>

</div>
4 changes: 2 additions & 2 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ func ReportError(ctx context.Context, err error) {
return
}

*errorList = append(*errorList, buildError(err))
*errorList = append(*errorList, BuildError(err))
}

func buildError(err error) ATError {
func BuildError(err error) ATError {
errType := reflect.TypeOf(err).String()

rootError := rootCause(err)
Expand Down
2 changes: 1 addition & 1 deletion outgoing.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (rt *roundTripper) RoundTrip(req *http.Request) (res *http.Response, err er
var errorList []ATError
if err != nil {
// Add the error for the given request payload
errorList = append(errorList, buildError(err))
errorList = append(errorList, BuildError(err))
}

var payload Payload
Expand Down

0 comments on commit 2d9224a

Please sign in to comment.