fediglam/src/main/models.zig

38 lines
642 B
Zig
Raw Normal View History

2022-07-18 07:37:10 +00:00
const std = @import("std");
const util = @import("util");
const Uuid = util.Uuid;
const DateTime = util.DateTime;
2022-07-13 04:16:33 +00:00
2022-07-10 23:53:17 +00:00
pub const Note = struct {
2022-07-13 04:16:33 +00:00
id: Uuid,
2022-07-10 23:53:17 +00:00
content: []const u8,
2022-07-18 06:11:42 +00:00
author_id: Uuid,
2022-07-18 07:37:10 +00:00
created_at: DateTime,
2022-07-10 23:53:17 +00:00
};
2022-07-13 04:56:47 +00:00
2022-07-22 04:19:08 +00:00
pub const Actor = struct {
2022-07-13 04:56:47 +00:00
id: Uuid,
handle: []const u8,
2022-07-21 05:26:13 +00:00
2022-07-22 04:19:08 +00:00
created_at: DateTime,
};
pub const LocalUser = struct {
actor_id: ?Uuid,
username: []const u8,
email: ?[]const u8,
2022-07-21 05:26:13 +00:00
hashed_password: []const u8, // encoded in PHC format, with salt
2022-07-22 04:19:08 +00:00
password_changed_at: DateTime,
created_at: DateTime,
2022-07-13 04:56:47 +00:00
};
2022-07-19 07:07:01 +00:00
pub const Reaction = struct {
reactor_id: Uuid,
note_id: Uuid,
};