Commit Graph

15 Commits

Author SHA1 Message Date
Miloslav Trmač 0e50c2bd38 Reformat with Go 1.19's gofmt
This is just the minimal update: the gofmt-created
updates have been reviewed and edited to preserve original
semantic intent, but I didn't review all
existing comments to benefit from the new syntax.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-08-10 20:38:52 +02:00
Dan Čermák 1678e3e92a Add simple documentation how to use c/image with podman's rootless mode
this fixes #1400

Signed-off-by: Dan Čermák <dcermak@suse.com>
2021-11-11 08:06:50 +01:00
Miloslav Trmač 4899cbee3c Update to major version v5
> gomove github.com/containers/image/v4 github.com/containers/image/v5
+ a manual edit of go.mod

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-10-25 22:27:45 +02:00
Miloslav Trmač 637b5b35a8 Correctly use a c/image/v4 module namespace
... so that major-version-aware Go module import
(as opposed to vX.Y.Z+incompatible, which does not allow different
packages to use different versions) works right.

Also requires adding some more GO111MODULE=on options to Makefile.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-10-03 22:54:27 +02:00
Sunny 956146f6cd Fix godoc code formatting
The example code in godoc were formatted inconsistently due to
indentations issues. This fixes the indentations, moving the example
into proper code block.

Signed-off-by: Sunny <me@darkowlzz.space>
2018-11-15 13:50:20 +05:30
Miloslav Trmač 9fa6aa40b8 Fix the example in doc.go
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2018-04-10 19:12:04 +02:00
Mike Lundy 77d0263114 Put context.Context arguments on almost everything
- Network IO paths should react to cancels now.
- File IO paths generally still won't.
- `SystemContext` objects have been renamed to `sys` to leave `ctx`
  available for the stdlib context objects.

Signed-off-by: Mike Lundy <mike@fluffypenguin.org>
2018-04-07 04:34:51 -07:00
Erik Hollensbe e2e0ae2f58 doc.go: Update intro source example
* gofmt source
* fix syntax in image name

Signed-off-by: Erik Hollensbe <github@hollensbe.org>
2017-02-06 15:26:38 -08:00
Miloslav Trmač e71d2b0e18 Add ImageSource.Close and Image.Close
These methods are necessary to clean up the temporary tar file copy in
daemonImageSource.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2016-09-05 22:46:45 +02:00
Miloslav Trmač 151faebaba Use types.SystemContext in NewImage*
... instead of Docker-specific certPath and tlsVerify.

Also invert the sense of tlsVerify to make the default secure.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2016-08-31 21:13:31 +02:00
Miloslav Trmač 9348591307 Add types.ImageTransport and types.ImageReference
This minimizes transport-specific knowledge in image name parsing
(as in cmd/skopeo/utils.go) and allows separation of reference parsing
and their use.

Existing public NewImage... API has been removed; callers are expected
to use any of
* types.ImageTransport.ParseReference().NewImage...
  (if they have a general string)
* transportpackage.ParseReference().NewImage...
  (if they have a transport-specific string)
* transportpackage.NewReference().NewImage...
  (if they have transport-specific raw values)

This usually adds an extra error checking step for the
ParseReference/NewReference call compared to the previous code; this is
considered not a big loss, especially because reporting “the reference
is invalid” and “the reference looks valid but connecting/using it
failed” as distinct failure modes seems quite useful for users.

The references are currently one-way (you can get a types.Image* from an
ImageReference, but not the other way around); that will be fixed soon.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2016-07-16 05:08:38 +02:00
Antonio Murdaca 6dfd79e932 docker: cleanup API
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-07-04 11:29:56 +02:00
Antonio Murdaca 1ca8286a09 doc.go: rename pkg to image
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-27 17:16:43 +02:00
Antonio Murdaca ec9c8041df move the project to a library
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-06-25 11:25:48 +02:00
Antonio Murdaca 29a8b325bd add doc.go stub
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-05-24 17:29:12 +02:00