Commit Graph

312 Commits

Author SHA1 Message Date
Deni Bertovic
70d77aa408 Merge branch 'dev' of https://github.com/jprider63/docker-hs into dev 2016-08-03 10:59:12 +02:00
jprider63
4824356fc3 exposed ports is apparently optional 2016-08-02 12:40:12 -04:00
James Parker
ae66f6951e include inspect container in tests 2016-08-02 12:30:51 -04:00
Deni Bertovic
35e5d76924 Reorganizes tests a bit and adds json test for ExposedPorts 2016-08-01 12:45:56 +02:00
Deni Bertovic
91bff38798 Adds caching to Travis CI
This should speed up tests.
2016-07-31 15:22:28 +02:00
Deni Bertovic
201fe06c91 Move under Docker.Client namespace
We re-export everything under Docker so a user can just use
"import Docker" and get everything that they need. But the core
of the library lives under the Docker.Client namespace.
2016-07-31 15:17:23 +02:00
Deni Bertovic
57a6d34bc4 Small readme change about contribution. 2016-07-31 14:44:29 +02:00
Deni Bertovic
2bf90f6caa Merge pull request #11 from denibertovic/dev
Merge refactored library changes into master
2016-07-31 14:39:38 +02:00
James Parker
7b62e6acae Added DeviceRate and DeviceWeight 2016-07-29 10:07:55 -05:00
James Parker
b15ae8ccdb Fixes for parsing inspection JSON responses 2016-07-28 21:41:53 -04:00
James Parker
f2b0128ea6 not sure how this was compiling before 2016-07-28 16:27:14 -04:00
jprider63
00502eb6a6 JSON fix 2016-07-28 16:20:34 -04:00
James Parker
1ae3e9525c work on HostConfig FromJSON instance 2016-07-28 15:45:45 -04:00
jprider63
b2b575e9f9 work in progress of fixing json parsing 2016-07-27 16:29:52 -04:00
James Parker
5241d7a082 export defaultContainerConfig and rename a few things 2016-07-26 17:29:02 +02:00
James Parker
9834323dfb small updates 2016-07-26 17:28:56 +02:00
James Parker
79d00d9c53 Squash commits into one.
...leaving the original commit messages below:

- Docker.Http compiles
- preliminary updates
- Using requestHelper for a few more functions
- check expected status codes for a given endpoint
- split up requestHelper by adding parseResponse. Updated create opts for
  docker api 1.24
- DockerT instances
- outline for inspect container. fixed some warnings
- generalize http handlers
- monadio instance
- switch to statusCodeToError from expectedStatusCode
- added tlssettings for client auth
- small change
- hide constructors for ContainerID and ImageID
- preliminary whitelist for ImageID and ContainerID
- types for container details and network settings
- include HostConfig and NetworkSettings in ContainerDetails
- some aeson instances
- more aeson instances
- Implemented getContainerLogs
- some aeson instances
- more aeson instances
- more aeson instances
- Re-export some functionality and hide others
- rewrote tests for new api
- added supported ciphers for ssl
- tests for ssl
- ability to set CA
- takes care of #10
- use CA in tests

Squashing more commits from both myself(Deni) and James into this one:

- Get rid of compiler warnings
- Mostly just unused imports and such.
- Removes old commented out code
- Adds defaultCreateOpts
  and some automatic style changes.
- Use local docker daemon in tests
  (for now without tls...)
- send POST bodies
- Sets application/json headers expliclty.
- Makes tests pass.
- Added ExposedPorts data type. Removed some manual
  to/from json instances in favour of ones generated by generics.
- Adds more json instance
  mostly pertaining to HostConfig
- Removes Storage driver options from HostConfig
  It's unclear from the docs and the go code how this is to be used
  and what it's for.
- Adds a better way to serialize CreateOpts
2016-07-26 17:23:13 +02:00
Deni Bertovic
9c6141317e Fixes Unix socket handler
Makes it so that it returns an Either as the
defaultHttpHandler does.
2016-07-04 21:55:02 +02:00
Deni Bertovic
fbe6e5b2e4 Removes duplicate imports 2016-07-04 21:54:51 +02:00
Deni Bertovic
d731cbacee Readme change. 2016-07-04 15:14:58 +02:00
Deni Bertovic
a8af75cfad Merge branch 'travis' 2016-07-04 15:03:40 +02:00
ocramz
9695cd0c1f Adds Travis config for running tests. 2016-07-04 15:02:58 +02:00
Deni Bertovic
05b211f0d1 WIP: Adds ongoing work on refactoring the http client
Does not compile yet.
2016-07-04 14:59:40 +02:00
Deni Bertovic
3526503fff Adds new extensions 2016-07-04 14:58:16 +02:00
Deni Bertovic
3df39a4f4e Adds repl target 2016-07-04 14:58:16 +02:00
Deni Bertovic
14c57b9465 Adds a few linter suggestions 2016-07-04 14:58:16 +02:00
Deni Bertovic
8eee9ba9c6 Moves http related stuff into own module 2016-07-04 14:58:16 +02:00
Deni Bertovic
b0cb71e422 Adds some more types for log endpoint
and makes sure the parameter ordering is consistent with
the rest of the functions
2016-07-04 14:56:12 +02:00
Deni Bertovic
870a4f4e73 Removes MonadThrow
I've changed my mind about this. I want the functions to be total
and return Either DockerError a. After some thinking, I don't think
the ExceptT IO antipattern pertains to this case becuase ExceptT isn't
exposed to the user rather the user get's Either Error a. The only one
who'll see the ExceptT are the libray maintainers.

The idea is to catch all the relevant exceptions in the defaultHttpHandler
so that the user doesn't have to care that they are dealing with a HTTP Api
because that's totally an implementation detail.

I realize that I'm sort of going the catch-all/mask-all road here but
I will only handle the most common cases to abstract away that we're
talking to Docker over a remote http api. I won't mask all, ie. I won't
catch SomeException and therefore break async exceptions that way.
For 99% of the cases this should be fine but for more advanced users
there's always the option of building their own httpHandler to handle
whatever special use-case they might have and the functions won't care
because they are polymorphic Monad wise.
2016-07-04 14:56:12 +02:00
Deni Bertovic
be93c8daa5 Merge pull request #8 from Philonous/dev
Add http handler for Unix domain sockets
2016-04-11 12:11:25 +02:00
Philipp Balzarek
7515583b03 add unixHttpManager
Allows connecting via a unix domain socket
2016-03-28 23:49:16 +02:00
Deni Bertovic
615cbd1a82 Remove unused type variable 2016-03-22 17:47:42 +01:00
Deni Bertovic
b2a25e984b Generalizes types and removes ExcepT
From what I read
here: https://www.schoolofhaskell.com/user/commercial/content/exceptions-best-practices
wrapping IO in ExceptT is considered an antipattern.

Instead we're using MonadThro.
Also we generalize our functions to accept any Monad that has an instance of MonadThrow.
This allows us to supply a httpHandler that runs in another Monad
and not just IO.
2016-03-17 13:31:01 +01:00
Deni Bertovic
07824379f5 Adds exceptions package to cabal file
and 2 new extensions
2016-03-17 13:27:15 +01:00
Deni Bertovic
580f0def88 Add quick contianer info for listing
and add port binding (which have a different structure
than the actual PortBinding while creating the container yay.)

also add returning of atleast of ContainerID on the endpoints that
return nothing. At least this way we can pipe stopContainer back
into startContainer without providing the contianer id in 2 places.
2016-03-15 16:47:22 +01:00
Deni Bertovic
e0a072a13e Adds todo note 2016-03-14 16:14:01 +01:00
Deni Bertovic
f5f0395466 Adds more endpoints
Needs factoring out of common parts. But first things first...
Let's get them all working and then refactor.
2016-03-14 15:48:23 +01:00
Deni Bertovic
b9fcd6cdfe Removes unnecessary type sig 2016-03-11 15:02:56 +01:00
Deni Bertovic
9ae1da143d Fixes type signatures for endpoints
We were mostly missing ContainerID in the type signatures for some
endpoints, and a concrete m in DockerT m, namely IO.
2016-03-11 15:00:00 +01:00
Deni Bertovic
da96a0eddc Removes unused extensions 2016-03-11 12:31:07 +01:00
Deni Bertovic
0ce23d1ce0 Added get version endpoint
first implementation anyway. Needs cleanup.
2016-03-11 12:30:45 +01:00
Deni Bertovic
7001ae92c3 Adds default http handler 2016-03-10 16:14:20 +01:00
Deni Bertovic
700626a3ec Fixes up imports a bit 2016-03-10 16:13:03 +01:00
Deni Bertovic
f3e8cc8ede Adds requests builder 2016-03-10 16:09:55 +01:00
Deni Bertovic
fa2bd89cf5 Adds todo 2016-03-10 15:34:57 +01:00
Deni Bertovic
c8c192aea3 Adds Devices to HostConfig
Fixes the wrong notion that they were somehow
the same as volumes.
2016-03-10 15:29:22 +01:00
Deni Bertovic
87d3b5a96d Adds back some of Internal module
- Added endpoint URL generating function
- Proper url encoding decoding (I guess, at least it's not printf
  anymore)
- Proper query building
2016-03-10 14:07:32 +01:00
Deni Bertovic
14970ddf1b Separates HttpHandler from Client options 2016-03-10 12:47:03 +01:00
Deni Bertovic
e25dc5883f Adds comment explaining exposed ports 2016-03-10 12:35:02 +01:00
Deni Bertovic
35ad36521e Stanardizes volumes/volumesfrom
No reason to have different naming and make things
more confusing just because those are the names used
internally within the docker daemon.
2016-03-04 18:12:31 +01:00