View Source Tentacat.Contents (Tentacat v2.4.0)
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.
Functions
@spec create(Tentacat.Client.t(), binary(), binary(), binary(), 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
@spec 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
@spec 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
@spec 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
@spec remove(Tentacat.Client.t(), binary(), binary(), binary(), 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
@spec update(Tentacat.Client.t(), binary(), binary(), binary(), 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