Files
gluetun/internal/updater/unzip/unzip.go
Quentin McGaw (desktop) 8b8bab5c58 Feature: IVPN support
2021-05-31 00:11:16 +00:00

25 lines
475 B
Go

// Package unzip defines the Unzipper which fetches and extract a zip file
// containing multiple files.
package unzip
import (
"context"
"net/http"
)
//go:generate mockgen -destination=mock_$GOPACKAGE/$GOFILE . Unzipper
type Unzipper interface {
FetchAndExtract(ctx context.Context, url string) (contents map[string][]byte, err error)
}
type unzipper struct {
client *http.Client
}
func New(client *http.Client) Unzipper {
return &unzipper{
client: client,
}
}