AssetsClient

Struct AssetsClient 

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

Assets API 客户端

Implementations§

Source§

impl AssetsClient

Source

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

创建新的 Assets API 客户端

Source

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

设置认证信息

Source

pub async fn get_repo_releases_download_tag_filename( &self, repo: String, tag: String, filename: String, share: Option<bool>, ) -> Result<Value>

发起一个获取 release 附件的请求,返回内容或者 302 到某个地址。Initiate a request to get release attachments, returns content or 302 redirect.

Source

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

发起一个上传 imgs 的请求,返回上传 cos 的 url 和 form 内容。发起一个上传 imgs 的请求,返回上传 cos 的 url 和 form 内容.

Source

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

发起一个获取 latest release 附件的请求,返回内容或者 302 到某个地址。Initiate a request to get latest release attachments, returns content or 302 redirect.

Source

pub async fn post_group_upload_logos( &self, group: String, request_data: Value, ) -> Result<Value>

发起一个上传 logo 的请求,返回上传 cos 的 url 和 form 内容。Post a request to upload a logo.

Source

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

发起一个上传 files 的请求,返回上传 cos 的 url 和 form 内容。Initiate a request to upload files,returns COS upload URL and form data.

Source

pub async fn get_repo_commit_assets_download_commit_id_filename( &self, repo: String, commit_id: String, filename: String, share: Option<bool>, ) -> Result<Value>

发起一个获取 commits 附件的请求,返回内容或者 302 到某个地址。Get a request to fetch a commit assets and returns the content directly or a 302 redirect to the assets URL.

Source

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

发起一个上传 release 附件的请求,返回上传 cos 的 url 。Initiate a request to upload release attachments,

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,