Code Monkey home page Code Monkey logo

apitoolkit-go's Introduction

APItoolkit's Logo APItoolkit's Logo

Golang SDK

APItoolkit SDK Join Discord Server APItoolkit Docs GoDoc

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.


Table of Contents


Installation

Kindly run the command below to install the SDK:

go get github.com/apitoolkit/apitoolkit-go

Then add github.com/apitoolkit/apitoolkit-go to the list of dependencies like so:

package main

import (
  apitoolkit "github.com/apitoolkit/apitoolkit-go"
)

Configuration

Next, initialize APItoolkit in your application's entry point (e.g., main.go) like so:

package main

import (
  "context"
  "log"
  "net/http"
  apitoolkit "github.com/apitoolkit/apitoolkit-go"
)

func main() {
  ctx := context.Background()

  // Initialize the client
  apitoolkitClient, err := apitoolkit.NewClient(ctx, apitoolkit.Config{APIKey: "{ENTER_YOUR_API_KEY_HERE}"})
  if err != nil {
    panic(err)
  }

  // Register APItoolkit's middleware
  http.Handle("/", apitoolkitClient.Middleware(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
    w.WriteHeader(http.StatusOK)
    w.Write([]byte("Hello, World!"))
  })))

  http.ListenAndServe(":8080", nil)
}

Note

  • This SDK supports multiple Golang frameworks (including, Chi, Echo, Fiber, Gin, Gorilla Mux, and Native). 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 generated from the APItoolkit dashboard.

Important

To learn more configuration options (redacting fields, error reporting, outgoing requests, etc.), please read this SDK documentation.

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:

License

This repository is published under the MIT license.


apitoolkit-go's People

Contributors

beesaferoot avatar bolajiayodeji avatar chee-zaram avatar davidhods avatar dawkaka avatar dependabot[bot] avatar spankie avatar tonyalaribe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

apitoolkit-go's Issues

Implement API Key functionality into the Go client.

The go client will be initialized with the API key as an argument.
On first run, the client will use this API key to query apitoolkit server for configuration and other metadata (fields that should be ignored, etc).

It will also get a temporary Google cloud pubsub key which it will use for the duration of that session to put requests into the pub sub queues.

testing webhook

Describe the bug

test

To Reproduce

No response

System

No response

Additional context

No response

Gorilla middleware

Create a version of the middleware that supports the gorilla web framework.

Send JSON payloads to GCP

Create a method that accepts JSON objects and sends it to a google cloud pub sub instance, using the golang SDK for pubsub, and to write a test for it

Fiber Implementation Docs

Just came across this cool service on twitter and would love to know how i can integrate it in go fiber.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.