╭ event.zig ────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
1 const std = @import("std"); 2 3 pub const id_size: usize = 32; 4 5 pub const EventData = union(enum) { 6 issue: struct { 7 title: []const u8, 8 description: []const u8, 9 tags: []const []const u8, 10 }, 11 }; 12 13 pub const Event = struct { 14 id: [id_size * 2]u8, 15 data: EventData, 16 }; 17 18 pub fn randomId(random: std.Random) [id_size]u8 { 19 var id_bytes: [id_size]u8 = undefined; 20 random.bytes(&id_bytes); 21 return id_bytes; 22 } 23