Skip to content

tacklebox-webhooks/golang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tacklebox

Overview

These are the instructions to install and use the Go client library for Tacklebox. Tacklebox is an open-source serverless framework that offers webhooks as a service.

It includes:

You can read more about our case study here.

The Team

Juan Palma Software Engineer Phoenix, AZ

Kevin Counihan Software Engineer Seattle, WA

Armando Mota Software Engineer Los Angeles, CA

Kayl Thomas Software Engineer Atlanta, GA

Getting Started

Install the Go library

To install the Go library for Tacklebox, run:

go get github.com/tacklebox-webhooks/golang

Use the Go library

Once you install the Go library for Tacklebox, you can start using it like so:

import "github.com/tacklebox-webhooks/golang"

// Initialize a Tacklebox object using the API Key and API Host
// obtained after running 'tacklebox deploy'
tb := tacklebox.Webhooks{ApiKey: API_KEY, BaseUrl: API_HOST}

Once you include the package and initialize a Tacklebox object, you can do many things. For example, you can create a service like so:

serviceData := map[string]interface{}{
    "name": "service1"}

tb.Service().Create(serviceData)

Once you create services, event types, users and subscriptions, you can create a new event like so:

serviceId := "d90af763-5839-4a90-834c-5512980984f5"
userId := "cabea1b5-b485-41b7-8146-72ece22dc458"

eventData := map[string]interface{}{
    "event_type": eventType,
    "payload": map[string]interface{}{
        "message": "Hello from the Go wrapper!"},
    "idempotency_key": "1"}

tb.Event().Create(serviceId, userId, eventData)

If you want to see the message log for a specific user and service:

serviceId := "d90af763-5839-4a90-834c-5512980984f5"
userId := "cabea1b5-b485-41b7-8146-72ece22dc458"

tb.Message().List(serviceId, userId)

About

Go client library for the Tacklebox webhook service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages