Gogs (gogs v0.3.0)
Documentation for the main Gogs
functions. <br />
This package is an Elixir
interface to our Gogs
Server.
It contains all functions we need to create repositories,
clone, add data to files, commit, push and diff.
Some of these functions use Git
and others use the REST API
.
We would obviously prefer if everything was one or the other,
but sadly, some things cannot be done via Git
or REST
so we have adopted a "hybrid" approach.
If anything is unclear, please open an issue: https://github.com/dwyl/gogs/issues
Link to this section Summary
Functions
clone/1
clones a remote git repository based on git_repo_url
returns the path of the local copy of the repository.
delete/1
accepts a single argument url
;
the url
for the repository to be deleted.
inject_poison/0
injects a TestDouble of HTTPoison in Test
so that we don't have duplicate mock in consuming apps.
see: github.com/dwyl/elixir-auth-google/issues/35
inject_poison/0
injects a TestDouble of HTTPoison in Test
so that we don't have duplicate mock in consuming apps.
see: github.com/dwyl/elixir-auth-google/issues/35
post/2
accepts two arguments: url
and params
.
Makes an HTTP POST
request to the specified url
passing in the params
as the request body.
Auth Headers and Content-Type are implicit.
remote_repo_create/3
accepts 3 arguments: org_name
, repo_name
& private
.
It creates a repo on the remote Gogs
instance as defined
by the environment variable GOGS_URL
.
For convenience it assumes that you only have one Gogs
instance.
If you have more or different requirements, please share!
remote_repo_delete/2
accepts two arguments: org_name
and repo_name
.
It deletes the repo on the remote Gogs
instance as defined
by the environment variable GOGS_URL
.
Link to this section Functions
clone(git_repo_url)
clone/1
clones a remote git repository based on git_repo_url
returns the path of the local copy of the repository.
delete(url)
delete/1
accepts a single argument url
;
the url
for the repository to be deleted.
inject_git()
inject_poison/0
injects a TestDouble of HTTPoison in Test
so that we don't have duplicate mock in consuming apps.
see: github.com/dwyl/elixir-auth-google/issues/35
inject_poison()
inject_poison/0
injects a TestDouble of HTTPoison in Test
so that we don't have duplicate mock in consuming apps.
see: github.com/dwyl/elixir-auth-google/issues/35
local_branch_create(repo_name, branch_name \\ "draft")
post(url, params \\ %{})
post/2
accepts two arguments: url
and params
.
Makes an HTTP POST
request to the specified url
passing in the params
as the request body.
Auth Headers and Content-Type are implicit.
remote_repo_create(org_name, repo_name, private \\ false)
remote_repo_create/3
accepts 3 arguments: org_name
, repo_name
& private
.
It creates a repo on the remote Gogs
instance as defined
by the environment variable GOGS_URL
.
For convenience it assumes that you only have one Gogs
instance.
If you have more or different requirements, please share!
remote_repo_delete(org_name, repo_name)
remote_repo_delete/2
accepts two arguments: org_name
and repo_name
.
It deletes the repo on the remote Gogs
instance as defined
by the environment variable GOGS_URL
.