undocker/rootfs/options.go
Motiejus Jakštys 436a866f5d add WithFilePrefix
This adds an option to prefix every file path with a given string.
2021-08-29 16:55:32 +03:00

21 lines
358 B
Go

package rootfs
type options struct {
filePrefix string
}
type Option interface {
apply(*options)
}
type filePrefixOption string
func (p filePrefixOption) apply(opts *options) {
opts.filePrefix = string(p)
}
// WithFilePrefixOption adds a prefix to all files in the output archive.
func WithFilePrefix(p string) Option {
return filePrefixOption(p)
}