Skip to content

v0.2.1 - Complete Architecture Implementation

Latest

Choose a tag to compare

@t0mk t0mk released this 27 Aug 12:32
· 3 commits to main since this release

πŸ”§ 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.