-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #324 from benjamin-747/main
Refactor: Added two modules as basic git object and storage provider
- Loading branch information
Showing
66 changed files
with
2,635 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
version https://gitmega.dev/spec/v1 | ||
{{objectType}} {{sha1}} | ||
storage_type {{type}} | ||
storage_locaton {{location}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[package] | ||
name = "jupiter" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[lib] | ||
name = "jupiter" | ||
path = "src/lib.rs" | ||
|
||
|
||
[dependencies] | ||
common = { path = "../common" } | ||
db_entity = { path = "./entity" } | ||
venus = { path = "../venus" } | ||
|
||
sea-orm = { workspace = true, features = [ | ||
"sqlx-postgres", | ||
"sqlx-mysql", | ||
"runtime-tokio-rustls", | ||
"macros", | ||
] } | ||
tracing = { workspace = true } | ||
bytes = { workspace = true } | ||
chrono = { workspace = true } | ||
async-trait = { workspace = true } | ||
futures = { workspace = true } | ||
serde_json ={ workspace = true } | ||
|
||
handlebars = "5.1.0" | ||
|
||
[dev-dependencies] | ||
tokio = { workspace = true, features = ["macros"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[package] | ||
name = "db_entity" | ||
version = "0.1.0" | ||
edition = "2021" | ||
publish = false | ||
|
||
[lib] | ||
name = "db_entity" | ||
path = "src/lib.rs" | ||
|
||
[dependencies] | ||
serde = { workspace = true, features = ["derive"] } | ||
chrono = { workspace = true } | ||
sea-orm = { workspace = true, features = ["sqlx-postgres", "sqlx-mysql"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
use sea_orm::{DeriveActiveEnum, EnumIter}; | ||
|
||
#[derive(Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum)] | ||
#[sea_orm(rs_type = "String", db_type = "String(Some(1))")] | ||
pub enum StorageType { | ||
#[sea_orm(string_value = "database")] | ||
Database, | ||
#[sea_orm(string_value = "local_fs")] | ||
LocalFs, | ||
#[sea_orm(string_value = "remote_url")] | ||
RemoteUrl, | ||
} | ||
|
||
impl ToString for StorageType { | ||
fn to_string(&self) -> String { | ||
match self { | ||
StorageType::Database => String::from("database"), | ||
StorageType::LocalFs => String::from("local_fs"), | ||
StorageType::RemoteUrl => String::from("remote_url"), | ||
} | ||
} | ||
} | ||
|
||
#[derive(Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum)] | ||
#[sea_orm(rs_type = "String", db_type = "String(Some(1))")] | ||
pub enum MergeStatus { | ||
#[sea_orm(string_value = "open")] | ||
Open, | ||
#[sea_orm(string_value = "merged")] | ||
Merged, | ||
#[sea_orm(string_value = "closed")] | ||
Closed, | ||
} | ||
|
||
|
||
|
||
#[derive(Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum)] | ||
#[sea_orm(rs_type = "String", db_type = "String(Some(1))")] | ||
pub enum RefType { | ||
#[sea_orm(string_value = "branch")] | ||
Branch, | ||
#[sea_orm(string_value = "tag")] | ||
Tag, | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 | ||
use sea_orm::entity::prelude::*; | ||
|
||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] | ||
#[sea_orm(table_name = "git_blob")] | ||
pub struct Model { | ||
#[sea_orm(primary_key, auto_increment = false)] | ||
pub id: i64, | ||
pub repo_id: i64, | ||
pub blob_id: String, | ||
pub name: Option<String>, | ||
pub size: i32, | ||
#[sea_orm(column_type = "Text")] | ||
pub full_path: String, | ||
#[sea_orm(column_type = "Text")] | ||
pub content: String, | ||
pub content_type: Option<String>, | ||
pub commit_id: String, | ||
pub created_at: DateTime, | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | ||
pub enum Relation {} | ||
|
||
impl ActiveModelBehavior for ActiveModel {} |
Oops, something went wrong.
7b35e23
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
mega – ./
mega-gitmono.vercel.app
gitmega.dev
mega-git-main-gitmono.vercel.app
www.gitmega.dev