╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Attachment.zig ───────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
93 var bytes: [evt.event_id_size]u8 = undefined; 94 _ = std.fmt.hexToBytes(&bytes, id) catch return null; 95 return bytes; 96 } 97 98 // the url an attachment's bytes are served from 99 pub fn url(page_arena: *std.heap.ArenaAllocator, identity: []const u8, id: []const u8) ![]const u8 { 100 return if (identity.len == 0) 101 try std.fmt.allocPrint(page_arena.allocator(), "/attachment:{s}", .{id}) 102 else 103 try std.fmt.allocPrint(page_arena.allocator(), "/{s}/attachment:{s}", .{ identity, id }); 104 } 105