treblle-go-fiber

command module
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2023 License: MIT Imports: 6 Imported by: 0

README

treblle-go-fiber

The offical Trebble SDK for Go using Fiber

Get Started

  1. Sign in to Treblle.
  2. Create a Treblle project.
Install the Go-Fiber SDK
go get github.com/RafaelPiloto10/treblle-go-fiber/trebble_fiber@latest

Basic configuration

Configure Treblle at the start of your main() function:

package main

import (
	treblle_fiber "github.com/RafaelPiloto10/treblle-go-fiber/trebble_fiber"
)

func main() {
	treblle_fiber.Configure(treblle_fiber.Configuration{
		APIKey:     "YOUR API KEY HERE",
		ProjectID:  "YOUR PROJECT ID HERE",
		KeysToMask: []string{"password", "card_number"}, // optional, mask fields you don't want sent to Treblle
		ServerURL:  "https://rocknrolla.treblle.com",    // optional, don't use default server URL
		IgnorePrefix: []string{"/pi"}, // optional, ignore routes that start with these prefixes
		IgnoreExact: []string{"/ping"}, // optional, ignore routes that match exactly
	}

    // rest of your program.
}

After that, just use the middleware with any of your handlers:

app := fiber.New(fiber.Config{})
app.Use(treblle_fiber.Middleware())
app.Listen("localhost:3000")

See the docs to learn more.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL