Add image handler wrapper
Gives clients more control of the pull process, allowing the client to operate on a descriptor after it has been pulled. This could be useful for filtering output or tracking children before they dispatched to. This can also be used to call custom unpackers to have visibility into a pulled config in parallel to the downloads. Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
@@ -179,6 +179,14 @@ func WithImageHandler(h images.Handler) RemoteOpt {
|
||||
}
|
||||
}
|
||||
|
||||
// WithImageHandlerWrapper wraps the handlers to be called on dispatch.
|
||||
func WithImageHandlerWrapper(w func(images.Handler) images.Handler) RemoteOpt {
|
||||
return func(client *Client, c *RemoteContext) error {
|
||||
c.HandlerWrapper = w
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// WithMaxConcurrentDownloads sets max concurrent download limit.
|
||||
func WithMaxConcurrentDownloads(max int) RemoteOpt {
|
||||
return func(client *Client, c *RemoteContext) error {
|
||||
|
||||
Reference in New Issue
Block a user