Skip to content

Releases: t0mk/tlytics

v0.2.1 - Complete Architecture Implementation

Choose a tag to compare

@t0mk t0mk released this 27 Aug 12:32

🔧 Complete Architecture Implementation

This patch release ensures the complete implementation of the client-server architecture refactor from v0.2.0.

✅ What's Included

Fully Implemented Features

  • Complete Client-Server Separation - All architecture changes properly implemented
  • EmitAndSend Method - Immediate event transmission with full error handling
  • Emitter Interface - Clean abstraction working across all components
  • Integration Tests - Comprehensive testing suite verifying end-to-end functionality

Verified Components

  • ✅ Client struct - Standalone client with all necessary methods
  • ✅ Tlytics struct - Server-only implementation
  • ✅ Middleware compatibility - Works with both Client and Server via Emitter interface
  • ✅ Example application - Updated and tested with new API
  • ✅ Test suite - All tests passing including integration tests

🚀 Usage

Client Usage (Immediate Send)

client, err := tlytics.NewClient(config)
if err != nil {
    log.Fatal(err)
}
defer client.Close()

// Test server connectivity immediately
err = client.EmitAndSend(tlytics.Event{
    Key: "connection_test",
    Data: map[string]interface{}{"status": "testing"},
})
if err != nil {
    log.Printf("Server connection failed: %v", err)
}

Client Usage (Queued)

// Queue events for batch sending
err = client.Emit(event) // Queued and sent automatically

Server Usage

server, err := tlytics.NewServer(serverConfig)
if err != nil {
    log.Fatal(err)
}
defer server.Close()

// Start server
err = server.StartServer()

🧪 Testing

All integration tests pass, verifying:

  • Client-server communication
  • Event storage and retrieval
  • Error handling for connection issues
  • Mixed immediate/queued event handling

Note: This release completes the architecture implementation from v0.2.0 with all components fully functional and tested.

v0.2.0 - Client-Server Refactor and EmitAndSend

Choose a tag to compare

@t0mk t0mk released this 27 Aug 12:17

🚀 Major Architecture Refactor

This release introduces significant improvements to the tlytics architecture, separating client and server concerns for better usability and maintainability.

✨ New Features

EmitAndSend Method

  • client.EmitAndSend(event) - Send events immediately with error handling
  • Perfect for testing server connectivity
  • Returns errors for connection issues
  • Bypasses the internal queue for instant transmission

Clean Client-Server Separation

  • NewClient() now returns *Client instead of *Tlytics
  • Tlytics struct is now server-only
  • Removed the isServer boolean field
  • Simplified API with clear separation of concerns

Emitter Interface

  • New Emitter interface implemented by both Client and Server
  • Middleware now accepts Emitter for flexibility
  • Clean abstraction for event emission

🧪 Testing Improvements

Comprehensive Integration Tests

  • TestClientServerIntegration - Full end-to-end testing
  • TestEmitAndSendConnectionError - Connection error handling
  • TestMultipleEventsIntegration - Concurrent event testing
  • Verifies message delivery and storage in database

🔄 API Changes

Breaking Changes

  • NewClient() returns *Client instead of *Tlytics
  • Middleware functions now accept Emitter interface
  • Tlytics struct no longer has client-related fields

Migration Guide

// Before v0.2.0
analytics, err := tlytics.NewClient(config) // returns *Tlytics
defer analytics.Close()

// v0.2.0+
client, err := tlytics.NewClient(config) // returns *Client
defer client.Close()

// For immediate sending (new feature)
err := client.EmitAndSend(event) // Send immediately with error handling

🏗️ Internal Improvements

  • Cleaner separation of client and server logic
  • Removed conditional isServer logic throughout codebase
  • Better error handling for network operations
  • More focused struct responsibilities

🧩 Compatibility

  • Middleware functions remain compatible (now use Emitter interface)
  • Close() method added to Client for API consistency
  • Backward compatibility maintained where possible

Full Changelog: v0.1.0...v0.2.0

Tlytics v0.1.3 - Final Module Path Fix

Choose a tag to compare

@t0mk t0mk released this 25 Aug 16:07

Patch Release

This is the definitive fix for Go module path issues. Previous releases had inconsistent module declarations across different tags.

🐛 Root Cause Fixed

The issue was that v0.1.0 tag still contained module tlytics while later versions had module github.com/t0mk/tlytics, causing Go's module resolution to get confused.

✅ What's Fixed

  • Consistent Module Path: All code now uses github.com/t0mk/tlytics
  • Clean Tag History: This release ensures no conflicting module declarations
  • Import Resolution: Should completely resolve the parsing error

🔧 Resolves Error

go: github.com/t0mk/tlytics@v0.1.2: parsing go.mod:
    module declares its path as: tlytics
            but was required as: github.com/t0mk/tlytics

💻 Usage

go get github.com/t0mk/tlytics@v0.1.3
import "github.com/t0mk/tlytics"

config := tlytics.Config{
    ServerURL:   "http://192.168.1.100:8081",
    FlushPeriod: 5 * time.Second,
}

analytics, err := tlytics.NewClient(config)

📝 Note for Users

If you're still experiencing issues, try:

  1. go clean -modcache to clear module cache
  2. go get github.com/t0mk/tlytics@v0.1.3

✅ Compatibility

  • Backward Compatible: All functionality remains the same
  • No Breaking Changes: API is unchanged
  • SemVer Compliant: Patch version increment (0.1.2 → 0.1.3)

Tlytics v0.1.2 - Module Import Fix

Choose a tag to compare

@t0mk t0mk released this 25 Aug 16:02

Patch Release

This patch release fixes Go module import path references that were causing import errors.

🐛 Bug Fixes

  • Import Path References: Updated all documentation to use github.com/t0mk/tlytics
  • Module Compatibility: Fixes module declares its path as errors
  • Documentation Consistency: All examples now use correct import paths

📦 Fixed Import Error

This resolves the error:

parsing go.mod:
module declares its path as: tlytics
        but was required as: github.com/t0mk/tlytics

💻 Correct Usage

import "github.com/t0mk/tlytics"

config := tlytics.Config{
    ServerURL:   "http://192.168.1.100:8081",
    FlushPeriod: 5 * time.Second,
}

analytics, err := tlytics.NewClient(config)

📦 Installation

go get github.com/t0mk/tlytics@v0.1.2

✅ Compatibility

  • Backward Compatible: All functionality remains the same
  • No Breaking Changes: API is unchanged
  • SemVer Compliant: Patch version increment (0.1.1 → 0.1.2)

Tlytics v0.1.1 - Module Path Correction

Choose a tag to compare

@t0mk t0mk released this 25 Aug 15:56

Patch Release

This is a patch release that corrects the Go module path for proper package management and imports.

🔧 Changes

  • Module Path Update: Changed from tlytics to github.com/t0mk/tlytics
  • Import Path Fix: Updated example code to use correct import path
  • Go Module Compliance: Now fully compliant with Go module best practices

📦 Installation

go get github.com/t0mk/tlytics

💻 Usage

import "github.com/t0mk/tlytics"

config := tlytics.Config{
    ServerURL:   "http://192.168.1.100:8081",
    FlushPeriod: 5 * time.Second,
}

analytics, err := tlytics.NewClient(config)

✅ Compatibility

  • Backward Compatible: All functionality remains the same
  • No Breaking Changes: API is unchanged
  • SemVer Compliant: Patch version increment (0.1.0 → 0.1.1)

This release ensures proper Go module management and makes the package easily installable via go get.

Tlytics v0.1.0 - Analytics Microservice

Choose a tag to compare

@t0mk t0mk released this 25 Aug 15:44

Initial Release

Tlytics is a lightweight, real-time analytics microservice written in Go. This initial release provides a complete microservice architecture for centralized analytics collection.

🏗️ Architecture

  • Microservice Design: Standalone analytics server with HTTP client libraries
  • Remote Connectivity: Applications connect via IP:port configuration (e.g., http://192.168.1.100:8081)
  • Centralized Storage: Single SQLite database for all analytics data
  • Network Communication: All events sent over HTTP with batching

✨ Features

  • Remote Event Collection: HTTP client automatically sends events to remote server
  • Batch Processing: Efficient client-side batching with configurable flush periods
  • SQLite Storage: Persistent storage on the analytics server
  • HTTP API: REST endpoints for event submission and data retrieval
  • Gin Middleware: Ready-to-use middleware for automatic request tracking
  • Docker Support: Containerized deployment with health checks
  • Pagination: Built-in pagination support for event retrieval
  • Network Resilience: Graceful handling of network errors

🚀 Quick Start

Server (Analytics Microservice):

go run cmd/tlytics/main.go --port 8081

Client (Your Application):

config := tlytics.Config{
    ServerURL:   "http://192.168.1.100:8081",
    FlushPeriod: 5 * time.Second,
}

analytics, err := tlytics.NewClient(config)
analytics.Emit(tlytics.Event{
    Key: "user_action",
    Data: map[string]interface{}{"action": "signup"},
})

📚 API Endpoints

  • POST /events - Submit analytics events
  • POST /batch - Submit batch of events
  • GET /view - Retrieve events with pagination
  • GET /health - Health check

🐳 Docker Deployment

docker-compose up --build

This follows semantic versioning (SemVer) - this is the first stable release with the core microservice architecture.