(writer io.WriteCloser, files []*FileInformation, ignoreMatcher ignoreparser.IgnoreParser)
| 940 | } |
| 941 | |
| 942 | func (u *upstream) compress(writer io.WriteCloser, files []*FileInformation, ignoreMatcher ignoreparser.IgnoreParser) (*Archiver, error) { |
| 943 | defer writer.Close() |
| 944 | |
| 945 | // Use compression |
| 946 | gw := gzip.NewWriter(writer) |
| 947 | defer gw.Close() |
| 948 | |
| 949 | // Create tar writer |
| 950 | tarWriter := tar.NewWriter(gw) |
| 951 | defer tarWriter.Close() |
| 952 | |
| 953 | // Archive the given files |
| 954 | archiver := NewArchiver(u.sync.LocalPath, tarWriter, ignoreMatcher) |
| 955 | for _, file := range files { |
| 956 | err := archiver.AddToArchive(file.Name) |
| 957 | if err != nil { |
| 958 | return nil, errors.Wrapf(err, "compress %s", file.Name) |
| 959 | } |
| 960 | } |
| 961 | |
| 962 | return archiver, nil |
| 963 | } |
| 964 | |
| 965 | func (u *upstream) uploadArchive(reader io.ReadCloser) error { |
| 966 | defer reader.Close() |
no test coverage detected