mirror of
https://github.com/qdm12/gluetun.git
synced 2026-08-05 03:43:24 +02:00
27 lines
394 B
Go
27 lines
394 B
Go
package unzip
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
)
|
|
|
|
type Unzipper struct {
|
|
client *http.Client
|
|
}
|
|
|
|
type contextKey int
|
|
|
|
const (
|
|
userAgentContextKey contextKey = iota
|
|
)
|
|
|
|
func WithUserAgent(ctx context.Context, userAgent string) context.Context {
|
|
return context.WithValue(ctx, userAgentContextKey, userAgent)
|
|
}
|
|
|
|
func New(client *http.Client) *Unzipper {
|
|
return &Unzipper{
|
|
client: client,
|
|
}
|
|
}
|