Skip to content

Commit

Permalink
replace NewClient with NewRegistryClient (#665)
Browse files Browse the repository at this point in the history
  • Loading branch information
theganyo authored Jul 19, 2022
1 parent 62bdd9f commit 2c94ac7
Show file tree
Hide file tree
Showing 59 changed files with 83 additions and 83 deletions.
2 changes: 1 addition & 1 deletion cmd/registry/cmd/annotate/annotate.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func Command() *cobra.Command {
Args: cobra.MinimumNArgs(2),
Run: func(cmd *cobra.Command, args []string) {
ctx := cmd.Context()
client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/annotate/annotate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestAnnotate(t *testing.T) {

// Create a registry client.
ctx := context.Background()
registryClient, err := connection.NewClient(ctx)
registryClient, err := connection.NewRegistryClient(ctx)
if err != nil {
t.Fatalf("Error creating client: %+v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/apply/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func Command() *cobra.Command {
Args: cobra.ExactArgs(0),
Run: func(cmd *cobra.Command, args []string) {
ctx := cmd.Context()
client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/registry/cmd/apply/apply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func TestApply(t *testing.T) {
t.Fatalf("Setup: Failed to create test project: %s", err)
}

registryClient, err := connection.NewClient(ctx)
registryClient, err := connection.NewRegistryClient(ctx)
if err != nil {
t.Fatalf("Setup: Failed to create registry client: %s", err)
}
Expand Down Expand Up @@ -173,7 +173,7 @@ func TestApplyProject(t *testing.T) {
t.Fatalf("Setup: Failed to create test project: %s", err)
}

registryClient, err := connection.NewClient(ctx)
registryClient, err := connection.NewRegistryClient(ctx)
if err != nil {
t.Fatalf("Setup: Failed to create registry client: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/compute/complexity.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func complexityCommand() *cobra.Command {
log.FromContext(ctx).WithError(err).Fatal("Failed to get dry-run from flags")
}

client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/compute/conformance.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func conformanceCommand() *cobra.Command {
log.FromContext(ctx).WithError(err).Fatal("Failed to get dry-run from flags")
}

client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/compute/conformance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ func TestConformance(t *testing.T) {
for _, test := range tests {
t.Run(test.desc, func(t *testing.T) {
ctx := context.Background()
client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
t.Fatalf("Setup: Failed to create client: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/compute/lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func lintCommand() *cobra.Command {
log.FromContext(ctx).WithError(err).Fatal("Failed to get fry-run from flags")
}

client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/compute/lintstats.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func lintStatsCommand() *cobra.Command {
log.FromContext(ctx).WithError(err).Fatal("Failed to get dry-run from flags")
}

client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/compute/references.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func referencesCommand() *cobra.Command {
log.FromContext(ctx).WithError(err).Fatal("Failed to get dry-run from flags")
}

client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/compute/score.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func scoreCommand() *cobra.Command {
log.FromContext(ctx).WithError(err).Fatal("Failed to get dry-run from flags")
}

client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/compute/scorecard.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func scoreCardCommand() *cobra.Command {
log.FromContext(ctx).WithError(err).Fatal("Failed to get dry-run from flags")
}

client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/compute/vocabulary.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func vocabularyCommand() *cobra.Command {
log.FromContext(ctx).WithError(err).Fatal("Failed to get dry-run from flags")
}

client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/count/revisions.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func revisionsCommand() *cobra.Command {
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
ctx := cmd.Context()
client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/count/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func versionsCommand() *cobra.Command {
Args: cobra.MinimumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
ctx := cmd.Context()
client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/delete/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func Command() *cobra.Command {
Args: cobra.MinimumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
ctx := cmd.Context()
client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/diff/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func Command() *cobra.Command {
Args: cobra.ExactArgs(2),
Run: func(cmd *cobra.Command, args []string) {
ctx := cmd.Context()
client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/export/csv.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func csvCommand() *cobra.Command {
},
Run: func(cmd *cobra.Command, args []string) {
ctx := cmd.Context()
client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/export/csv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (

func TestExportCSV(t *testing.T) {
ctx := context.Background()
client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
t.Fatalf("Setup: Failed to create client: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/export/sheet.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func sheetCommand() *cobra.Command {
Run: func(cmd *cobra.Command, args []string) {
ctx := cmd.Context()
var path string
client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/export/yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func yamlCommand() *cobra.Command {
Args: cobra.MinimumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
ctx := cmd.Context()
client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/get/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func Command() *cobra.Command {
Args: cobra.MinimumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
ctx := cmd.Context()
client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/index/union.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func unionCommand() *cobra.Command {
log.FromContext(ctx).WithError(err).Fatal("Failed to get filter from flags")
}

client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/label/label.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func Command() *cobra.Command {
Args: cobra.MinimumNArgs(2),
Run: func(cmd *cobra.Command, args []string) {
ctx := cmd.Context()
client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/label/label_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestLabel(t *testing.T) {

// Create a registry client.
ctx := context.Background()
registryClient, err := connection.NewClient(ctx)
registryClient, err := connection.NewRegistryClient(ctx)
if err != nil {
t.Fatalf("Error creating client: %+v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func Command() *cobra.Command {
Args: cobra.MinimumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
ctx := cmd.Context()
client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/resolve/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func Command() *cobra.Command {
log.FromContext(ctx).WithError(err).Fatal("Invalid manifest resource name")
}

client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/resolve/resolve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func TestResolve(t *testing.T) {
for _, test := range tests {
t.Run(test.desc, func(t *testing.T) {
ctx := context.Background()
client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
t.Fatalf("Setup: Failed to create client: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/rpc/generated/registry_service.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/registry/cmd/upload/artifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func artifactCommand() *cobra.Command {
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to read artifact")
}
client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
12 changes: 6 additions & 6 deletions cmd/registry/cmd/upload/artifact_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func TestApiSpecExtensionListArtifactUpload(t *testing.T) {

SetUpProject(ctx, t, project)

client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
t.Fatalf("Setup: Failed to create client: %s", err)
}
Expand Down Expand Up @@ -160,7 +160,7 @@ func TestManifestArtifactUpload(t *testing.T) {

SetUpProject(ctx, t, test.project)

client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
t.Fatalf("Setup: Failed to create client: %s", err)
}
Expand Down Expand Up @@ -256,7 +256,7 @@ func TestScoreDefinitionArtifactUpload(t *testing.T) {

SetUpProject(ctx, t, test.project)

client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
t.Fatalf("Setup: Failed to create client: %s", err)
}
Expand Down Expand Up @@ -328,7 +328,7 @@ func TestScoreCardDefinitionArtifactUpload(t *testing.T) {

SetUpProject(ctx, t, test.project)

client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
t.Fatalf("Setup: Failed to create client: %s", err)
}
Expand Down Expand Up @@ -400,7 +400,7 @@ func TestScoreArtifactUpload(t *testing.T) {

SetUpProject(ctx, t, test.project)

client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
t.Fatalf("Setup: Failed to create client: %s", err)
}
Expand Down Expand Up @@ -513,7 +513,7 @@ func TestScoreCardArtifactUpload(t *testing.T) {

SetUpProject(ctx, t, test.project)

client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
t.Fatalf("Setup: Failed to create client: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/upload/bulk/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func discoveryCommand() *cobra.Command {
log.FromContext(ctx).WithError(err).Fatal("Failed to get project-id from flags")
}

client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/upload/bulk/openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func openAPICommand() *cobra.Command {
log.FromContext(ctx).WithError(err).Fatal("Failed to get project-id from flags")
}

client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/upload/bulk/protos.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func protosCommand() *cobra.Command {
log.FromContext(ctx).WithError(err).Fatal("Failed to get project-id from flags")
}

client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/upload/csv.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func csvCommand() *cobra.Command {
log.Fatalf(ctx, "Invalid delimiter %q: must be exactly one character", delimiter)
}

client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/upload/csv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func TestUploadCSV(t *testing.T) {
for _, test := range tests {
t.Run(test.desc, func(t *testing.T) {
ctx := context.Background()
client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
t.Fatalf("Setup: Failed to create client: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/upload/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func manifestCommand() *cobra.Command {
}

manifestData, _ := proto.Marshal(manifest)
client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
log.FromContext(ctx).WithError(err).Fatal("Failed to get client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/cmd/upload/manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestManifestUpload(t *testing.T) {
for _, test := range tests {
t.Run(test.desc, func(t *testing.T) {
ctx := context.Background()
client, err := connection.NewClient(ctx)
client, err := connection.NewRegistryClient(ctx)
if err != nil {
t.Fatalf("Setup: Failed to create client: %s", err)
}
Expand Down
Loading

0 comments on commit 2c94ac7

Please sign in to comment.