Centralizes configuration, eliminates unnecessary copying of config

This commit is contained in:
Nikolay Govorov
2026-01-26 03:22:45 +00:00
parent 6d9517f6ea
commit f71aa1cad2
13 changed files with 836 additions and 742 deletions

View File

@@ -8,6 +8,7 @@ const Allocator = std.mem.Allocator;
const log = @import("../log.zig");
const App = @import("../App.zig");
const Http = @import("../http/Http.zig");
const Config = @import("../Config.zig");
const telemetry = @import("telemetry.zig");
const URL = "https://telemetry.lightpanda.io";
@@ -55,7 +56,7 @@ pub const LightPanda = struct {
self.connection.deinit();
}
pub fn send(self: *LightPanda, iid: ?[]const u8, run_mode: App.RunMode, raw_event: telemetry.Event) !void {
pub fn send(self: *LightPanda, iid: ?[]const u8, run_mode: Config.RunMode, raw_event: telemetry.Event) !void {
const event = try self.mem_pool.create();
event.* = .{
.iid = iid,
@@ -130,7 +131,7 @@ pub const LightPanda = struct {
const LightPandaEvent = struct {
iid: ?[]const u8,
mode: App.RunMode,
mode: Config.RunMode,
event: telemetry.Event,
node: std.DoublyLinkedList.Node,