Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@

// Mirror the version from the `opentelemetry-proto` repository.
// This is a [Semantic Version](https://semver.org/).
.version = "1.7.0",
.version = "1.8.0",

.fingerprint = 0x83b04c56bb34864b, // Changing this has security and trust implications.

.minimum_zig_version = "0.14.1",
.minimum_zig_version = "0.15.1",

.dependencies = .{
.protobuf = .{
.url = "https://github.com/Arwalk/zig-protobuf/archive/da4d17264fcfdd793e71b3a8b466fb0f05bc6fd3.tar.gz",
.hash = "protobuf-2.0.0-0e82asubGwBS6OnkIzYh6-uiIV35Lbt4OHvmGTvcJNo_",
.url = "git+https://github.com/Arwalk/zig-protobuf?ref=v3.0.0#b2b5e70d7669b45cdbb42ed8ebab512e982ee5d5",
.hash = "protobuf-2.0.0-0e82an3rJACrCrLX7sohjL3qQIcDUV_x7NgEo1AORXUD",
},
},
// Paths must include the generated code.
.paths = .{
"build.zig",
"build.zig.zon",
Expand Down
181 changes: 168 additions & 13 deletions src/opentelemetry/proto/collector/logs/v1.pb.zig
Original file line number Diff line number Diff line change
@@ -1,44 +1,199 @@
// Code generated by protoc-gen-zig
///! package opentelemetry.proto.collector.logs.v1
const std = @import("std");
const Allocator = std.mem.Allocator;
const ArrayList = std.ArrayList;

const protobuf = @import("protobuf");
const ManagedString = protobuf.ManagedString;
const fd = protobuf.fd;
const ManagedStruct = protobuf.ManagedStruct;
/// import package opentelemetry.proto.logs.v1
const opentelemetry_proto_logs_v1 = @import("../../logs/v1.pb.zig");

pub const ExportLogsServiceRequest = struct {
resource_logs: ArrayList(opentelemetry_proto_logs_v1.ResourceLogs),
resource_logs: std.ArrayListUnmanaged(opentelemetry_proto_logs_v1.ResourceLogs) = .empty,

pub const _desc_table = .{
.resource_logs = fd(1, .{ .List = .{ .SubMessage = {} } }),
.resource_logs = fd(1, .{ .repeated = .submessage }),
};

pub usingnamespace protobuf.MessageMixins(@This());
pub fn encode(
self: @This(),
writer: *std.Io.Writer,
allocator: std.mem.Allocator,
) (std.Io.Writer.Error || std.mem.Allocator.Error)!void {
return protobuf.encode(writer, allocator, self);
}

pub fn decode(
reader: *std.Io.Reader,
allocator: std.mem.Allocator,
) (protobuf.DecodingError || std.Io.Reader.Error || std.mem.Allocator.Error)!@This() {
return protobuf.decode(@This(), reader, allocator);
}

pub fn deinit(self: *@This(), allocator: std.mem.Allocator) void {
return protobuf.deinit(allocator, self);
}

pub fn dupe(self: @This(), allocator: std.mem.Allocator) std.mem.Allocator.Error!@This() {
return protobuf.dupe(@This(), self, allocator);
}

pub fn jsonDecode(
input: []const u8,
options: std.json.ParseOptions,
allocator: std.mem.Allocator,
) !std.json.Parsed(@This()) {
return protobuf.json.decode(@This(), input, options, allocator);
}

pub fn jsonEncode(
self: @This(),
options: std.json.Stringify.Options,
allocator: std.mem.Allocator,
) ![]const u8 {
return protobuf.json.encode(self, options, allocator);
}

// This method is used by std.json
// internally for deserialization. DO NOT RENAME!
pub fn jsonParse(
allocator: std.mem.Allocator,
source: anytype,
options: std.json.ParseOptions,
) !@This() {
return protobuf.json.parse(@This(), allocator, source, options);
}

// This method is used by std.json
// internally for serialization. DO NOT RENAME!
pub fn jsonStringify(self: *const @This(), jws: anytype) !void {
return protobuf.json.stringify(@This(), self, jws);
}
};

pub const ExportLogsServiceResponse = struct {
partial_success: ?ExportLogsPartialSuccess = null,

pub const _desc_table = .{
.partial_success = fd(1, .{ .SubMessage = {} }),
.partial_success = fd(1, .submessage),
};

pub usingnamespace protobuf.MessageMixins(@This());
pub fn encode(
self: @This(),
writer: *std.Io.Writer,
allocator: std.mem.Allocator,
) (std.Io.Writer.Error || std.mem.Allocator.Error)!void {
return protobuf.encode(writer, allocator, self);
}

pub fn decode(
reader: *std.Io.Reader,
allocator: std.mem.Allocator,
) (protobuf.DecodingError || std.Io.Reader.Error || std.mem.Allocator.Error)!@This() {
return protobuf.decode(@This(), reader, allocator);
}

pub fn deinit(self: *@This(), allocator: std.mem.Allocator) void {
return protobuf.deinit(allocator, self);
}

pub fn dupe(self: @This(), allocator: std.mem.Allocator) std.mem.Allocator.Error!@This() {
return protobuf.dupe(@This(), self, allocator);
}

pub fn jsonDecode(
input: []const u8,
options: std.json.ParseOptions,
allocator: std.mem.Allocator,
) !std.json.Parsed(@This()) {
return protobuf.json.decode(@This(), input, options, allocator);
}

pub fn jsonEncode(
self: @This(),
options: std.json.Stringify.Options,
allocator: std.mem.Allocator,
) ![]const u8 {
return protobuf.json.encode(self, options, allocator);
}

// This method is used by std.json
// internally for deserialization. DO NOT RENAME!
pub fn jsonParse(
allocator: std.mem.Allocator,
source: anytype,
options: std.json.ParseOptions,
) !@This() {
return protobuf.json.parse(@This(), allocator, source, options);
}

// This method is used by std.json
// internally for serialization. DO NOT RENAME!
pub fn jsonStringify(self: *const @This(), jws: anytype) !void {
return protobuf.json.stringify(@This(), self, jws);
}
};

pub const ExportLogsPartialSuccess = struct {
rejected_log_records: i64 = 0,
error_message: ManagedString = .Empty,
error_message: []const u8 = &.{},

pub const _desc_table = .{
.rejected_log_records = fd(1, .{ .Varint = .Simple }),
.error_message = fd(2, .String),
.rejected_log_records = fd(1, .{ .scalar = .int64 }),
.error_message = fd(2, .{ .scalar = .string }),
};

pub usingnamespace protobuf.MessageMixins(@This());
pub fn encode(
self: @This(),
writer: *std.Io.Writer,
allocator: std.mem.Allocator,
) (std.Io.Writer.Error || std.mem.Allocator.Error)!void {
return protobuf.encode(writer, allocator, self);
}

pub fn decode(
reader: *std.Io.Reader,
allocator: std.mem.Allocator,
) (protobuf.DecodingError || std.Io.Reader.Error || std.mem.Allocator.Error)!@This() {
return protobuf.decode(@This(), reader, allocator);
}

pub fn deinit(self: *@This(), allocator: std.mem.Allocator) void {
return protobuf.deinit(allocator, self);
}

pub fn dupe(self: @This(), allocator: std.mem.Allocator) std.mem.Allocator.Error!@This() {
return protobuf.dupe(@This(), self, allocator);
}

pub fn jsonDecode(
input: []const u8,
options: std.json.ParseOptions,
allocator: std.mem.Allocator,
) !std.json.Parsed(@This()) {
return protobuf.json.decode(@This(), input, options, allocator);
}

pub fn jsonEncode(
self: @This(),
options: std.json.Stringify.Options,
allocator: std.mem.Allocator,
) ![]const u8 {
return protobuf.json.encode(self, options, allocator);
}

// This method is used by std.json
// internally for deserialization. DO NOT RENAME!
pub fn jsonParse(
allocator: std.mem.Allocator,
source: anytype,
options: std.json.ParseOptions,
) !@This() {
return protobuf.json.parse(@This(), allocator, source, options);
}

// This method is used by std.json
// internally for serialization. DO NOT RENAME!
pub fn jsonStringify(self: *const @This(), jws: anytype) !void {
return protobuf.json.stringify(@This(), self, jws);
}
};
Loading