JavaScript is disabled, refresh for a better experience. ambee/giterated

ambee/giterated

Git repository hosting, collaboration, and discovery for the Fediverse.

Completely refactor project structure

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨ae8ff44

⁨giterated-daemon/src/backend/discovery.rs⁩ - ⁨555⁩ bytes
Raw
1 use std::hash::Hash;
2
3 use chrono::{DateTime, Utc};
4 use serde::{Deserialize, Serialize};
5 use sqlx::PgPool;
6
7 pub struct GiteratedDiscoveryProtocol {
8 pub pool: PgPool,
9 }
10
11 #[derive(Debug, Hash, Serialize, Deserialize, Clone, sqlx::Type)]
12 #[sqlx(type_name = "discovery_type", rename_all = "lowercase")]
13 pub enum DiscoveryType {
14 Instance,
15 Repository,
16 }
17
18 #[derive(Debug, sqlx::FromRow, sqlx::Type)]
19 pub struct DiscoveriesRow {
20 discovery_hash: String,
21 discovery_time: DateTime<Utc>,
22 discovery_type: DiscoveryType,
23 discovery: String,
24 }
25