玲珑仓库概要设计说明书

玲珑仓库概要设计说明书

ll-repo-cli-builder、ll-repo-server交互流程图

ll-repo-clill-builder命令行输入用户名和密码并向ll-repo-server发起登录请求ll-repo-server生成唯一token返回tokenll-repo-clill-builder发起业务请求,token附带在http请求header中ll-repo-server处理业务逻辑返回业务逻辑处理结果yesll-repo-server校验token?noyesll-repo-server校验密码noyes解析命令?终端提示ll-repo-clill-builder命令行执行结果

ll-cli、ll-repo-server交互流程图

ll-cli命令行ll-cli发起业务请求,/etc/linglong/auth/access.yaml作为token附带在http请求header中ll-repo-server向授权服务器验证token有效性ll-repo-server处理业务逻辑返回业务逻辑处理结果yestoken有效?noyesll-repo-server判断请求header中是否有token?noyes解析命令?no终端提示ll-cli命令行执行结果

store、ll-store-server交互流程图

store向ll-store-server发起登录请求ll-store-server校验密码生成唯一tokenstore发起业务请求带上tokenll-store-server校验tokenll-server处理业务逻辑ll-server返回业务逻辑处理结果store展示应用

ll-repo-server数据结构

App

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
type App struct {
gorm.Model
AppId string `json:"appId" gorm:"type:varchar(100);column:app_id;NOT NULL;uniqueIndex:idx_channel_app_id_version_arch_module,priority:2"`
Name string `json:"name" gorm:"column:name"`
Version string `json:"version" gorm:"type:varchar(50);column:version;NOT NULL;uniqueIndex:idx_channel_app_id_version_arch_module,priority:3"`
Arch string `json:"arch" gorm:"type:varchar(20);column:arch;NOT NULL;uniqueIndex:idx_channel_app_id_version_arch_module,priority:4"`
Kind string `json:"kind" gorm:"column:kind"`
Runtime string `json:"runtime" gorm:"column:runtime"`
RepoName string `json:"repoName" gorm:"column:repo_name"`
Description string `json:"description" gorm:"column:description"`
Size int64 `json:"size" gorm:"column:size"`
Channel string `json:"channel" gorm:"type:varchar(50);column:channel;NOT NULL;uniqueIndex:idx_channel_app_id_version_arch_module,priority:1"`
Module string `json:"module" gorm:"type:varchar(50);column:module;NOT NULL;uniqueIndex:idx_channel_app_id_version_arch_module,priority:5"`
CheckSum string `json:"check_sum" gorm:"column:check_sum"`
}

app表候选键:

  • app_id
  • version
  • arch
  • channel
  • module

Repo

1
2
3
4
5
6
type Repo struct {
gorm.Model
Repo string `json:"repo" gorm:"column:repo;uniqueIndex:idx_repo,priority:1"` // 仓库名
Mode string `json:"mode" gorm:"column:mode"` // 以给定模式初始化存储库(bare、bare-user、bare-user-only、archive)
Description string `json:"description" gorm:"column:description"` // 仓库描述信息
}

repo表候选键:

  • repo // 仓库名

User

1
2
3
4
5
6
7
type User struct {
gorm.Model
User string `json:"user" gorm:"column:user;uniqueIndex:idx_user,priority:1"` // 用户名
Passwd string `json:"passwd" gorm:"column:passwd"` // 密码
RepoName string `json:"repoName" gorm:"column:repo_name"` // 仓库名
Role string `json:"role" gorm:"column:role"` // 角色 (Maintainer、Developer、Reporter、Guest)
}

user表候选键:

  • user 用户名

SyncTask

1
2
3
4
5
6
7
8
type SyncTask struct {
gorm.Model
Task string `json:"task" gorm:"column:task;"` // 同步任务名称
SourceUrl string `json:"source_url" gorm:"column:source_url"` // 数据源url
SourceRepoName string `json:"source_repo_name" gorm:"column:source_repo_name"` // 数据源仓库名
TargetRepoName string `json:"target_repo_name" gorm:"column:target_repo_name"` // 目的源仓库名
Progress string `json:"progress" gorm:"column:progress"` // 同步进度百分比
}

sync_task表候选键:

  • task // 同步任务名称
1
2
3
4
5
6
7
8
9
10
11
type SyncedApp struct {
gorm.Model
Task string `json:"task" gorm:"column:task;NOT NULL;uniqueIndex:idx_task_channel_app_id_version_arch_module,priority,priority:1"` // 同步任务名称
AppId string `json:"appId" gorm:"type:varchar(100);column:app_id;NOT NULL;uniqueIndex:idx_task_channel_app_id_version_arch_module,priority,priority:3"`
Version string `json:"version" gorm:"type:varchar(50);column:version;NOT NULL;uniqueIndex:idx_task_channel_app_id_version_arch_module,priority,priority:4"`
Arch string `json:"arch" gorm:"type:varchar(20);column:arch;NOT NULL;uniqueIndex:idx_task_channel_app_id_version_arch_module,priority,priority:5"`
Channel string `json:"channel" gorm:"type:varchar(50);column:channel;NOT NULL;uniqueIndex:idx_task_channel_app_id_version_arch_module,priority,priority:2"`
Module string `json:"module" gorm:"type:varchar(50);column:module;NOT NULL;uniqueIndex:idx_task_channel_app_id_version_arch_module,priority,priority:6"`
Synced int `json:"synced" gorm:"column:synced;"` // 是否已同步

}
  • task // 同步任务名称
  • app_id
  • version
  • arch
  • channel
  • module

玲珑仓库概要设计说明书
https://realwujing.github.io/patent/玲珑仓库概要设计说明书/
作者
Wu Jing
发布于
2023年4月17日
许可协议