https://github.com/operable/cog-api-client
https://github.com/operable/cog-api-client
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/operable/cog-api-client
- Owner: operable
- Created: 2016-03-09T16:19:17.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-03-28T14:11:48.000Z (almost 9 years ago)
- Last Synced: 2025-02-24T10:36:47.557Z (about 1 year ago)
- Language: Elixir
- Size: 550 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# CogApi
[](https://travis-ci.org/operable/cog-api-client)
[](https://coveralls.io/github/operable/cog-api-client?branch=master)
## Installation
1. Add cog_api to your list of dependencies in `mix.exs`:
```elixir
{:cog_api, github: "operable/cog-api-client"},
```
2. Ensure cog_api is started before your application:
```elixir
def application do
[applications: [:cog_api]]
end
```
## Stucture
There are two main areas of CogApi.
### CogApi.HTTP.Client
This is the primary client that is recommended for usage. This is being tested
as it is updated.
Alongside this, there is a `CogApi.Fake.Client`.
This is designed for testing
and local development purposes.
The API for `Fake.Client`
and `HTTP.Client`
are designed to be identical.
If it functions in `Fake`
it should function the same in `HTTP`.
When adding anything to `HTTP.Client` and `HTTP.Fake`, please:
* Ensure that there are tests for the functionality
* Update the CHANGELOG.md with any changes
* Ensure that `CogApi.Client` is updated with the proper `@callback` so that we
can ensure that the `Fake` and `HTTP` are in sync.
### CogApi.HTTP.Internal
This client is for use only in `cogctl`.
Do not touch this!
It is also not recommended for external users to use this module.
Eventually `cogctl` will switch to using the `HTTP.Client`
and `Internal` will be removed.
## Tests
Tests and static analysis can be run with:
```
bin/test_suite
```
If tests fail, the script will not perform static analysis.
Run only tests with: `mix test`
ExVcr tests are executed against a local installation of Cog using user "admin"
with the password set to "password". When making a change to the API, you can
record new cassettes by deleting the files you wish to regenerate and run the tests.
Be sure to bootstrap a clean instance of Cog when doing so.
## Static Analysis
Run `mix dialyzer` to run analysis. If your dependencies or your elixir version
change, run `bin/rebuild_plt`.
Note: `dialyzer` requires Elixir v1.2.3 to work properly.