Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

add log option to new #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,24 @@ type Registry struct {
* This passes http.DefaultTransport to WrapTransport when creating the
* http.Client.
*/
func New(registryUrl, username, password string) (*Registry, error) {
func New(registryUrl, username, password string, log func(string, ...interface{})) (*Registry, error) {
transport := http.DefaultTransport

return newFromTransport(registryUrl, username, password, transport, Log)
return newFromTransport(registryUrl, username, password, transport, log)
}

/*
* Create a new Registry, as with New, using an http.Transport that disables
* SSL certificate verification.
*/
func NewInsecure(registryUrl, username, password string) (*Registry, error) {
func NewInsecure(registryUrl, username, password string, log func(string, ...interface{})) (*Registry, error) {
transport := &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
},
}

return newFromTransport(registryUrl, username, password, transport, Log)
return newFromTransport(registryUrl, username, password, transport, log)
}

/*
Expand Down