const std = @import("std"); const mem = std.mem; const heap = std.heap; const json = std.json; const Io = std.Io; // Keeping it just to not break config files in future const Method = enum { bind, }; const Mount = struct { target: []const u8, directories: []const Directory = &.{}, files: []const File = &.{}, }; const File = struct { path: [:0]const u8, method: Method = .bind, }; const Directory = struct { path: [:0]const u8, method: Method = .bind, }; mounts: []const Mount, const Self = @This(); pub fn load(io: Io, alloc: mem.Allocator, path: []const u8) !struct { Self, *heap.ArenaAllocator } { const source = try Io.Dir.cwd().readFileAlloc(io, path, alloc, .unlimited); const parsed = try json.parseFromSlice(Self, alloc, source, .{}); return .{ parsed.value, parsed.arena }; }