moby/pkg
Vincent Batts 4026512a2c events/jsonmessage: add and prefer TimeNano for events
This way provide both Time and TimeNano in the event. For the display of
the JSONMessage, use either, but prefer TimeNano Proving only TimeNano
would break Subscribers that are using the `Time` field, so both are set
for backwards compatibility.

The events logging uses nano formatting, but only provides a Unix()
time, therefor ordering may get lost in the output. Example:
```
2015-09-15T14:18:51.000000000-04:00 ee46febd64ac629f7de9cd8bf58582e6f263d97ff46896adc5b508db804682da: (from busybox) resize
2015-09-15T14:18:51.000000000-04:00 a78c9149b1c0474502a117efaa814541926c2ae6ec3c76607e1c931b84c3a44b: (from busybox) resize
```

By having a field just for Nano time, when set, the marshalling back to
`time.Unix(sec int64, nsec int64)` has zeros exactly where it needs to.
This does not break any existing use of jsonmessage.JSONMessage, but now
allows for use of `UnixNano()` and get event formatting that has
distinguishable order. Example:
```
2015-09-15T15:37:23.810295632-04:00 6adcf8ed9f5f5ec059a915466cd1cde86a18b4a085fc3af405e9cc9fecbbbbaf: (from busybox) resize
2015-09-15T15:37:23.810412202-04:00 6b7c5bfdc3f902096f5a91e628f21bd4b56e32590c5b4b97044aafc005ddcb0d: (from busybox) resize
```

Including tests for TimeNano and updated event API reference doc.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-09-18 13:15:26 -04:00
..
ansiescape Use notary library for trusted image fetch and signing 2015-07-24 14:08:20 -07:00
archive Windows: Fix long path handling for docker build 2015-09-15 10:58:11 -07:00
broadcastwriter Use a slice instead of a map of io.WriteClosers in broadcastwriter 2015-08-21 14:08:04 +01:00
chrootarchive Windows: Fix long path handling for docker build 2015-09-15 10:58:11 -07:00
devicemapper pkg: devicemapper: fix typo in function declaration 2015-09-09 15:57:52 +02:00
directory Windows: Fix long path handling for docker build 2015-09-15 10:58:11 -07:00
fileutils Add missing tests and docs for pkg/fileutils 2015-07-12 22:43:42 +02:00
graphdb Merge pull request #16054 from jfrazelle/update-sqlite3-dep 2015-09-03 19:20:57 -07:00
homedir Update libcontainer 2015-07-16 16:02:26 -07:00
httputils Update httputils tests 2015-09-09 14:59:25 +02:00
integration Skip racey TestDockerCmdInDirWithTimeout 2015-09-17 15:30:07 +02:00
ioutils pkg/ioutils: lower bufReader reset timeout 2015-08-28 23:13:02 +03:00
jsonlog Enable golint in pkg/jsonlog and pkg/jsonmessage. 2015-08-08 11:28:22 +08:00
jsonmessage events/jsonmessage: add and prefer TimeNano for events 2015-09-18 13:15:26 -04:00
listenbuffer linting changes 2015-06-17 01:16:57 +03:00
longpath Windows: Fix long path handling for docker build 2015-09-15 10:58:11 -07:00
mflag typofix - https://github.com/vlajos/misspell_fixer 2015-08-07 23:25:49 +01:00
mount pkg: mount: golint 2015-07-22 10:26:10 +02:00
namesgenerator Normalized, ungrouped, and sorted names 2015-09-01 21:57:01 -07:00
nat Adding support to publish on custom host port ranges 2015-08-15 02:41:29 +00:00
parsers Remove PortMapping from container NetworkSettings 2015-09-02 14:32:53 +02:00
pidfile Lint on pkg/* packages 2015-07-27 21:26:21 +02:00
plugins Lint package pkg/plugins/pluginrpc-gen 2015-09-05 23:15:13 +02:00
pools Lint on pkg/* packages 2015-07-27 21:26:21 +02:00
progressreader Make Broadcaster Wait function wait for all writers to finish before returning 2015-09-11 10:54:40 -07:00
promise Move Go() promise-like func from utils to pkg/promise 2014-09-29 23:16:27 -07:00
proxy Lint on pkg/* packages 2015-07-27 21:26:21 +02:00
pubsub Don't use time.After if there is no timeout 2015-07-14 09:14:51 -07:00
random Prefer crypto rand seed for pkg/rand 2015-07-29 12:55:57 -04:00
reexec make docker compile on freebsd 2015-07-29 21:25:56 +03:00
signal Signal to stop a container. 2015-09-10 19:56:05 -04:00
sockets make docker compile on freebsd 2015-07-29 21:25:56 +03:00
stdcopy fix golint warnings/errors on pkg/system and pkg/stdcopy 2015-08-13 18:47:13 +08:00
streamformatter Lint on pkg/* packages 2015-07-27 21:26:21 +02:00
stringid Add GenerateNonCryptoID function to avoid entropy exhaustion 2015-07-28 22:31:01 -07:00
stringutils pkg: stringutils: Add more tests to strslice 2015-09-01 20:27:45 +02:00
symlink Windows: Fix long path handling for docker build 2015-09-15 10:58:11 -07:00
sysinfo Add support for kernel memory limit 2015-08-19 23:56:55 +08:00
system Windows: Fix use of IsAbs check 2015-08-26 12:38:28 -07:00
tailfile typofix - https://github.com/vlajos/misspell_fixer 2015-08-07 23:25:49 +01:00
tarsum tarsum: add a big fat warning 2015-08-25 16:50:08 -04:00
term Remove unused variable, fix #16310 2015-09-15 22:20:10 +02:00
timeoutconn Lint on pkg/* packages 2015-07-27 21:26:21 +02:00
timeutils Lint on pkg/* packages 2015-07-27 21:26:21 +02:00
tlsconfig tlsconfig: better format for error message in tlsconfig 2015-07-30 14:15:41 -04:00
truncindex Remove read index that causes dead lock. 2015-07-31 13:53:17 -07:00
ulimit Lint on pkg/* packages 2015-07-27 21:26:21 +02:00
units Multiple fixes to 'docker stats' output: 2015-07-30 10:14:57 +03:00
urlutil Lint on pkg/* packages 2015-07-27 21:26:21 +02:00
useragent Lint on pkg/* packages 2015-07-27 21:26:21 +02:00
version Fix minor typo 2015-03-25 00:46:22 +08:00
README.md Add README to pkg 2013-12-23 23:12:19 +00:00

pkg/ is a collection of utility packages used by the Docker project without being specific to its internals.

Utility packages are kept separate from the docker core codebase to keep it as small and concise as possible. If some utilities grow larger and their APIs stabilize, they may be moved to their own repository under the Docker organization, to facilitate re-use by other projects. However that is not the priority.

The directory pkg is named after the same directory in the camlistore project. Since Brad is a core Go maintainer, we thought it made sense to copy his methods for organizing Go code :) Thanks Brad!

Because utility packages are small and neatly separated from the rest of the codebase, they are a good place to start for aspiring maintainers and contributors. Get in touch if you want to help maintain them!