Something went wrong. Try again.
xburner is an experimental HTTP and gRPC load generator written in Zig.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435const std = @import("std");
const config = @import("../config.zig");const grpc_executor = @import("../protocol/grpc_executor.zig");const http_executor = @import("../protocol/http_executor.zig");const template = @import("../template.zig");
const http = std.http;
const TlsContext = http_executor.TlsContext;
pub const Session = struct { client: http.Client, grpc_client: grpc_executor.Client, tls_context: TlsContext, shared_store: template.VarStore,
pub fn init(allocator: std.mem.Allocator, scenario: *const config.ScenarioConfig) !Session { return .{ .client = .{ .allocator = allocator }, .grpc_client = grpc_executor.Client.init(), .tls_context = try TlsContext.init(allocator, &scenario.http), .shared_store = template.VarStore.init(allocator), }; }
pub fn deinit(self: *Session) void { self.shared_store.deinit(); self.tls_context.deinit(); self.grpc_client.deinit(); self.client.deinit(); self.* = undefined; }};