git_store
Types
pub opaque type ForgeConfig
Values
pub fn create_file(
config: ForgeConfig,
filename: String,
content: String,
) -> Result(types.PlatformResponse, errors.GitStoreError)
Create a file from a file object on a repository at the given path https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28#create-or-update-file-contents
pub fn delete_file(
config: ForgeConfig,
filename: String,
) -> Result(types.PlatformResponse, errors.GitStoreError)
Delete an object from a reposititory if it exists https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28#delete-a-file
pub fn get_file(
config: ForgeConfig,
path: String,
) -> Result(types.PlatformResponse, errors.GitStoreError)
Get a file object from a repository at the given path Path should be a ‘/’ separated String, e.g: ‘wibble/wobble/wubble’ https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28#get-repository-content https://codeberg.org/api/swagger#/repository/repoGetContents
pub fn new_codeberg_config(
owner: String,
repo: String,
token: String,
) -> ForgeConfig
pub fn new_forgejo_config(
owner: String,
repo: String,
token: String,
url: String,
) -> ForgeConfig
pub fn new_github_config(
owner: String,
repo: String,
token: String,
) -> ForgeConfig
pub fn update_file(
config: ForgeConfig,
filename: String,
content: String,
) -> Result(types.PlatformResponse, errors.GitStoreError)
Get a file object from a repository and, if it exists, replace the content with the given content https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28#create-or-update-file-contents