Skip to content

Commit

Permalink
obsservice: move the http proxy to its own package
Browse files Browse the repository at this point in the history
Release note: None
  • Loading branch information
andreimatei committed Jun 23, 2022
1 parent 726e978 commit 7e07fc1
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion pkg/obsservice/cmd/obsservice/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ go_library(
visibility = ["//visibility:private"],
deps = [
"//pkg/cli/exit",
"//pkg/obsservice/obslib",
"//pkg/obsservice/obslib/httpproxy",
"//pkg/obsservice/obslib/migrations",
"@com_github_spf13_cobra//:cobra",
],
Expand Down
6 changes: 3 additions & 3 deletions pkg/obsservice/cmd/obsservice/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"fmt"

"github.com/cockroachdb/cockroach/pkg/cli/exit"
"github.com/cockroachdb/cockroach/pkg/obsservice/obslib"
"github.com/cockroachdb/cockroach/pkg/obsservice/obslib/httpproxy"
"github.com/cockroachdb/cockroach/pkg/obsservice/obslib/migrations"
"github.com/spf13/cobra"
)
Expand All @@ -27,7 +27,7 @@ var RootCmd = &cobra.Command{
from one or more CockroachDB clusters.`,
Run: func(cmd *cobra.Command, args []string) {
ctx := context.Background()
cfg := obslib.ReverseHTTPProxyConfig{
cfg := httpproxy.ReverseHTTPProxyConfig{
HTTPAddr: httpAddr,
TargetURL: targetURL,
CACertPath: caCertPath,
Expand All @@ -40,7 +40,7 @@ from one or more CockroachDB clusters.`,
}

// Block forever running the proxy.
<-obslib.NewReverseHTTPProxy(ctx, cfg).RunAsync(ctx)
<-httpproxy.NewReverseHTTPProxy(ctx, cfg).RunAsync(ctx)
},
}

Expand Down
15 changes: 0 additions & 15 deletions pkg/obsservice/obslib/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,15 +0,0 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "obslib",
srcs = ["lib.go"],
importpath = "github.com/cockroachdb/cockroach/pkg/obsservice/obslib",
visibility = ["//visibility:public"],
deps = [
"//pkg/cli/exit",
"//pkg/util/log",
"//pkg/util/syncutil",
"@com_github_cockroachdb_cmux//:cmux",
"@com_github_cockroachdb_errors//:errors",
],
)
15 changes: 15 additions & 0 deletions pkg/obsservice/obslib/httpproxy/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "httpproxy",
srcs = ["reverseproxy.go"],
importpath = "github.com/cockroachdb/cockroach/pkg/obsservice/obslib/httpproxy",
visibility = ["//visibility:public"],
deps = [
"//pkg/cli/exit",
"//pkg/util/log",
"//pkg/util/syncutil",
"@com_github_cockroachdb_cmux//:cmux",
"@com_github_cockroachdb_errors//:errors",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
// http://www.apache.org/licenses/LICENSE-2.0

package obslib
package httpproxy

import (
"context"
Expand Down

0 comments on commit 7e07fc1

Please sign in to comment.