Tentacat v1.6.0 Tentacat.Contents View Source
Link to this section Summary
Functions
Create a file
Get the contents of a file or directory in a repository
Get the contents of a file or directory in a repository for a provided reference
Get the contents of README.md
Deletes a file in a repository
Update a file
Link to this section Functions
create(client, owner, repo, path, body)
View Source
create(Tentacat.Client.t(), binary(), binary(), binary(), list() | map()) ::
Tentacat.response()
create(Tentacat.Client.t(), binary(), binary(), binary(), list() | map()) :: Tentacat.response()
Create a file
Create body example:
%{
"message" => "my commit message",
"committer" => %{
"name" => "Grigory Starinkin",
"email" => "starinkin@gmail.com"
},
"content" => "bXkgbmV3IGZpbGUgY29udGVudHM=",
"branch" => "cool-feature"
}
Example
Tentacat.Contents.create client, "elixir-lang", "elixir", "lib/elixir.ex", body
More info at: https://developer.github.com/v3/repos/contents/#create-a-file
find(client \\ %Client{}, owner, repo, path)
View Source
find(Tentacat.Client.t(), binary(), binary(), binary()) :: Tentacat.response()
find(Tentacat.Client.t(), binary(), binary(), binary()) :: Tentacat.response()
Get the contents of a file or directory in a repository.
Example
Tentacat.Contents.find "elixir-lang", "elixir", "lib"
Tentacat.Contents.find client, "elixir-lang", "elixir", "lib"
More info at: https://developer.github.com/v3/repos/contents/#get-contents
find_in(client \\ %Client{}, owner, repo, path, ref)
View Source
find_in(Tentacat.Client.t(), binary(), binary(), binary(), binary()) ::
Tentacat.response()
find_in(Tentacat.Client.t(), binary(), binary(), binary(), binary()) :: Tentacat.response()
Get the contents of a file or directory in a repository for a provided reference
Example
Tentacat.Contents.find_in "elixir-lang", "elixir", "lib", "ref-name"
Tentacat.Contents.find_in client, "elixir-lang", "elixir", "lib", "ref-name"
More info at: https://developer.github.com/v3/repos/contents/#get-contents
readme(client \\ %Client{}, owner, repo)
View Source
readme(Tentacat.Client.t(), binary(), binary()) :: Tentacat.response()
readme(Tentacat.Client.t(), binary(), binary()) :: Tentacat.response()
Get the contents of README.md.
Example
Tentacat.Contents.readme "elixir-lang", "elixir"
Tentacat.Contents.readme client, "elixir-lang", "elixir"
More info at: https://developer.github.com/v3/repos/contents/#get-the-readme
remove(client, owner, repo, path, body)
View Source
remove(Tentacat.Client.t(), binary(), binary(), binary(), list() | map()) ::
Tentacat.response()
remove(Tentacat.Client.t(), binary(), binary(), binary(), list() | map()) :: Tentacat.response()
Deletes a file in a repository
Delete body example:
%{
"message" => "my commit message",
"committer" => %{
"name" => "Grigory Starinkin",
"email" => "starinkin@gmail.com"
},
"sha" => "329688480d39049927147c162b9d2deaf885005f",
"branch" => "cool-feature"
}
Example
Tentacat.Contents.remove client, "elixir-lang", "elixir", "lib/elixir.ex", body
More info at: https://developer.github.com/v3/repos/contents/#delete-a-file
update(client, owner, repo, path, body)
View Source
update(Tentacat.Client.t(), binary(), binary(), binary(), list() | map()) ::
Tentacat.response()
update(Tentacat.Client.t(), binary(), binary(), binary(), list() | map()) :: Tentacat.response()
Update a file
Update body example:
%{
"message" => "my commit message",
"committer" => %{
"name" => "Grigory Starinkin",
"email" => "starinkin@gmail.com"
},
"content" => "bXkgdXBkYXRlZCBmaWxlIGNvbnRlbnRz",
"sha" => "329688480d39049927147c162b9d2deaf885005f",
"branch" => "cool-feature"
}
Example
Tentacat.Contents.update client, "elixir-lang", "elixir", "lib/elixir.ex", body
More info at: https://developer.github.com/v3/repos/contents/#update-a-file