logsnag

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: MIT Imports: 5 Imported by: 0

README

Logsnag.go

A go module for publishing events and insights to LogSnag.

Installation

go get github.com/samuel-pratt/logsnag.go

Usage

Import Library
import (
	"github.com/samuel-pratt/logsnag.go"
)
Initialize Client
logSnag := logsnag.NewLogSnag(
    "7f568d735724351757637b1dbf108e5",
    "my-saas"
)
Publish Event
logSnag.Publish(
    "waitlist",         // Channel
    "User Joined",      // Event
    "🛥️",               // Icon
    map[string]any{     // Tags
        "name": "john doe",
        "email": "john@example.com",
    },
    true,               // Notify
)
Publish Insight
logSnag.Insight(
    "User Count",   // Title
    "100",          // Value
    "🛥️",           // Icon
)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogSnag

type LogSnag struct {
	Token   string
	Project string
}

func NewLogSnag

func NewLogSnag(token string, project string) LogSnag

func (*LogSnag) GetProject

func (logsnag *LogSnag) GetProject() string

func (*LogSnag) Insight

func (logsnag *LogSnag) Insight(title string, value string, icon string) bool

func (*LogSnag) Publish

func (logsnag *LogSnag) Publish(channel string, event string, icon string, tags map[string]any, notify bool) bool

Jump to

Keyboard shortcuts

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