GitClient

Struct GitClient 

Source
pub struct GitClient { /* private fields */ }
Expand description

Git API 客户端

Implementations§

Source§

impl GitClient

Source

pub fn new(base_url: String, client: Client) -> Self

创建新的 Git API 客户端

Source

pub fn with_auth(self, token: &str) -> Self

设置认证信息

Source

pub async fn get_repo_git_branches_branch( &self, repo: String, branch: String, ) -> Result<Value>

查询指定分支。Get a branch.

Source

pub async fn delete_repo_git_branches_branch( &self, repo: String, branch: String, ) -> Result<Value>

删除指定分支。Delete the specified branch.

Source

pub async fn get_repo_git_commit_annotations_sha( &self, repo: String, sha: String, ) -> Result<Value>

查询指定 commit 的元数据。Get commit annotations.

Source

pub async fn put_repo_git_commit_annotations_sha( &self, repo: String, sha: String, put_commit_annotations_form: Value, ) -> Result<Value>

设定指定 commit 的元数据。Put commit annotations.

Source

pub async fn get_repo_git_branches( &self, repo: String, page: Option<i64>, page_size: Option<i64>, ) -> Result<Value>

查询分支列表。List branches.

Source

pub async fn post_repo_git_branches( &self, repo: String, create_branch_form: Value, ) -> Result<Value>

创建新分支。Create a new branch based on a start point.

Source

pub async fn get_repo_git_commits( &self, repo: String, sha: Option<String>, author: Option<String>, committer: Option<String>, since: Option<String>, until: Option<String>, page: Option<i64>, page_size: Option<i64>, ) -> Result<Value>

查询 commit 列表。List commits.

Source

pub async fn get_repo_git_archive_compare_changed_files_base_head( &self, repo: String, base_head: String, ) -> Result<Value>

打包下载两次 ref 之间的变更文件。Download archive of changed files for a compare.

Source

pub async fn post_repo_git_blobs( &self, repo: String, post_blob_form: Value, ) -> Result<Value>

创建一个 blob。Create a blob.

Source

pub async fn get_repo_git_tag_annotations_tag( &self, repo: String, tag: String, ) -> Result<Value>

查询指定 tag 的元数据。Query the metadata of the specified tag.

Source

pub async fn put_repo_git_tag_annotations_tag( &self, repo: String, tag: String, put_tag_annotations_form: Value, ) -> Result<Value>

设定指定 tag 的元数据。Set the metadata of the specified tag.

Source

pub async fn get_repo_git_commit_statuses_commitish( &self, repo: String, commitish: String, ) -> Result<Value>

查询指定 commit 的 check statuses。List commit check statuses.

Source

pub async fn get_repo_git_deferred_commits( &self, repo: String, cs: String, ) -> Result<Value>

查询 deferred commit 列表

Source

pub async fn delete_repo_git_tag_annotations_tag_with_key( &self, repo: String, tag_with_key: String, ) -> Result<Value>

删除指定 tag 的元数据。Delete the metadata of the specified tag.

Source

pub async fn get_repo_git_commit_assets_sha_1( &self, repo: String, sha_1: String, ) -> Result<Value>

查询指定 commit 的附件。List commit assets.

Source

pub async fn get_repo_git_tags( &self, repo: String, page: Option<i64>, page_size: Option<i64>, ) -> Result<Value>

查询标签列表。List tags.

Source

pub async fn post_repo_git_tags( &self, repo: String, post_tag_form: Value, ) -> Result<Value>

创建一个 tag。Create a tag.

Source

pub async fn post_repo_git_commit_annotations_in_batch( &self, repo: String, get_commit_annotations_form: Value, ) -> Result<Value>

查询指定 commit 的元数据。Get commit annotations in batch.

Source

pub async fn post_repo_git_commit_assets_sha_1_asset_upload_confirmation_upload_token_asset_path( &self, repo: String, sha_1: String, token: String, asset_path: String, ) -> Result<Value>

确认 Commit asset 上传完成。Confirm commit asset upload.

Source

pub async fn get_repo_git_archive_commit_changed_files_sha_1( &self, repo: String, sha_1: String, ) -> Result<Value>

打包下载 commit 变更文件。Download archive of changed files for a commit.

Source

pub async fn delete_repo_git_commit_annotations_sha_key( &self, repo: String, sha: String, key: String, ) -> Result<Value>

删除指定 commit 的元数据。Delete commit annotation.

Source

pub async fn get_repo_git_tags_tag( &self, repo: String, tag: String, ) -> Result<Value>

查询指定 Tag。Get a tag.

Source

pub async fn delete_repo_git_tags_tag( &self, repo: String, tag: String, ) -> Result<Value>

删除指定标签。Delete the specified tag.

Source

pub async fn delete_repo_git_commit_assets_sha_1_asset_id( &self, repo: String, sha_1: String, asset_id: String, ) -> Result<Value>

删除指定 commit 的附件。Delete commit asset.

Source

pub async fn get_repo_git_contents_file_path( &self, repo: String, file_path: String, ref: Option<String>, ) -> Result<Value>

查询仓库文件列表或文件。List repository files or file.

Source

pub async fn get_repo_git_head(&self, repo: String) -> Result<Value>

获取仓库默认分支。Get the default branch of the repository.

Source

pub async fn get_repo_git_commits_ref( &self, repo: String, ref: String, ) -> Result<Value>

查询指定 commit。Get a commit.

Source

pub async fn get_repo_git_compare_base_head( &self, repo: String, base_head: String, ) -> Result<Value>

对比 base…head。Compare two commits.

Source

pub async fn post_repo_git_commit_assets_sha_1_asset_upload_url( &self, repo: String, sha_1: String, create_commit_asset_upload_url_form: Value, ) -> Result<Value>

新增一个 Commit asset。Create a commit asset.

Source

pub async fn get_repo_lfs_oid( &self, repo: String, oid: String, name: String, ) -> Result<Value>

获取 git lfs 文件下载链接

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,