Skip to content

Commit

Permalink
make it private
Browse files Browse the repository at this point in the history
Signed-off-by: razzle <harry@razzle.cloud>
  • Loading branch information
Noxsios committed Mar 7, 2024
1 parent 0f6158f commit 36b4edc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/pkg/oci/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const (
type OrasRemote struct {
repo *remote.Repository
root *Manifest
Transport *helpers.Transport
progTransport *helpers.Transport
targetPlatform *ocispec.Platform
log *slog.Logger
}
Expand All @@ -46,7 +46,7 @@ func WithPlainHTTP(plainHTTP bool) Modifier {
// WithInsecureSkipVerify sets the insecure TLS flag for the remote
func WithInsecureSkipVerify(insecure bool) Modifier {
return func(o *OrasRemote) {
o.Transport.Base.(*http.Transport).TLSClientConfig.InsecureSkipVerify = insecure
o.progTransport.Base.(*http.Transport).TLSClientConfig.InsecureSkipVerify = insecure
}
}

Expand Down Expand Up @@ -85,7 +85,7 @@ func NewOrasRemote(url string, platform ocispec.Platform, mods ...Modifier) (*Or
client.Client.Transport = transport
o := &OrasRemote{
repo: &remote.Repository{Client: client},
Transport: helpers.NewTransport(transport, nil),
progTransport: helpers.NewTransport(transport, nil),
targetPlatform: &platform,
log: slog.Default(),
}
Expand All @@ -103,14 +103,14 @@ func NewOrasRemote(url string, platform ocispec.Platform, mods ...Modifier) (*Or

// SetProgressWriter sets the progress writer for the remote
func (o *OrasRemote) SetProgressWriter(bar helpers.ProgressWriter) {
o.Transport.ProgressBar = bar
o.repo.Client.(*auth.Client).Client.Transport = o.Transport
o.progTransport.ProgressBar = bar
o.repo.Client.(*auth.Client).Client.Transport = o.progTransport
}

// ClearProgressWriter clears the progress writer for the remote
func (o *OrasRemote) ClearProgressWriter() {
o.Transport.ProgressBar = nil
o.repo.Client.(*auth.Client).Client.Transport = o.Transport
o.progTransport.ProgressBar = nil
o.repo.Client.(*auth.Client).Client.Transport = o.progTransport
}

// Repo gives you access to the underlying remote repository
Expand Down

0 comments on commit 36b4edc

Please sign in to comment.