-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add example for listing repositories in registry target #117
Conversation
Signed-off-by: Billy Zha <[email protected]>
Signed-off-by: Billy Zha <[email protected]>
Signed-off-by: Billy Zha <[email protected]>
Should we create a new file named |
registry/remote/registry_test.go
Outdated
if err != nil { | ||
panic(err) // Handle error | ||
} | ||
reg.RepositoryOptions.PlainHTTP = true // Use HTTP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be simplified as reg.PlainHTTP = true
.
registry/remote/registry_test.go
Outdated
fn := func(repos []string) error { // Setup a callback function to process returned repository list | ||
for _, repo := range repos { | ||
fmt.Println(repo) | ||
} | ||
return nil | ||
} | ||
|
||
ctx := context.Background() | ||
reg.Repositories(ctx, fn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may also want to show something like this first:
ctx := context.Background()
repos, err := registry.Repositories(ctx, reg)
if err != nil {
panic(err)
}
fmt.Println(repos)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be added to another function ExampleRepositories
, will do that
Signed-off-by: Billy Zha <[email protected]>
Signed-off-by: Billy Zha <[email protected]>
Done. I also added an example for the static method in registry package |
Signed-off-by: Billy Zha <[email protected]>
Signed-off-by: Billy Zha <[email protected]>
Signed-off-by: Billy Zha <[email protected]>
Signed-off-by: Billy Zha <[email protected]>
Signed-off-by: Billy Zha <[email protected]>
Signed-off-by: Billy Zha <[email protected]>
Signed-off-by: Billy Zha <[email protected]>
Signed-off-by: Billy Zha <[email protected]>
Signed-off-by: Billy Zha <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…#117) Signed-off-by: Billy Zha <[email protected]>
…#117) Signed-off-by: Billy Zha <[email protected]>
…#117) Signed-off-by: Billy Zha <[email protected]>
…#117) Signed-off-by: Billy Zha <[email protected]>
This PR works for item #60 and adds an example for listing repositories.