diff --git a/cmd/server/BUILD.bazel b/cmd/server/BUILD.bazel index 2f27bc092a..0978dd0125 100644 --- a/cmd/server/BUILD.bazel +++ b/cmd/server/BUILD.bazel @@ -11,10 +11,10 @@ go_library( visibility = ["//visibility:private"], deps = [ "//pkg/admin:go_default_library", - "//pkg/app/api/api:go_default_library", "//pkg/app/api/applicationlivestatestore:go_default_library", "//pkg/app/api/authhandler:go_default_library", "//pkg/app/api/commandstore:go_default_library", + "//pkg/app/api/grpcapi:go_default_library", "//pkg/app/api/pipedverifier:go_default_library", "//pkg/app/api/service/webservice:go_default_library", "//pkg/app/api/stagelogstore:go_default_library", diff --git a/cmd/server/server.go b/cmd/server/server.go index f63c6fdb5e..64e662dda7 100644 --- a/cmd/server/server.go +++ b/cmd/server/server.go @@ -29,10 +29,10 @@ import ( "golang.org/x/sync/errgroup" "github.com/pipe-cd/pipe/pkg/admin" - "github.com/pipe-cd/pipe/pkg/app/api/api" "github.com/pipe-cd/pipe/pkg/app/api/applicationlivestatestore" "github.com/pipe-cd/pipe/pkg/app/api/authhandler" "github.com/pipe-cd/pipe/pkg/app/api/commandstore" + "github.com/pipe-cd/pipe/pkg/app/api/grpcapi" "github.com/pipe-cd/pipe/pkg/app/api/pipedverifier" "github.com/pipe-cd/pipe/pkg/app/api/service/webservice" "github.com/pipe-cd/pipe/pkg/app/api/stagelogstore" @@ -189,7 +189,7 @@ func (s *server) run(ctx context.Context, t cli.Telemetry) error { datastore.NewPipedStore(ds), t.Logger, ) - service = api.NewPipedAPI(ctx, ds, sls, alss, cmds, t.Logger) + service = grpcapi.NewPipedAPI(ctx, ds, sls, alss, cmds, t.Logger) opts = []rpc.Option{ rpc.WithPort(s.pipedAPIPort), rpc.WithGracePeriod(s.gracePeriod), @@ -228,9 +228,9 @@ func (s *server) run(ctx context.Context, t cli.Telemetry) error { var service rpc.Service if s.useFakeResponse { - service = api.NewFakeWebAPI() + service = grpcapi.NewFakeWebAPI() } else { - service = api.NewWebAPI(ctx, ds, sls, alss, cmds, cfg.ProjectMap(), encryptDecrypter, t.Logger) + service = grpcapi.NewWebAPI(ctx, ds, sls, alss, cmds, cfg.ProjectMap(), encryptDecrypter, t.Logger) } opts := []rpc.Option{ rpc.WithPort(s.webAPIPort), diff --git a/pkg/app/api/api/BUILD.bazel b/pkg/app/api/grpcapi/BUILD.bazel similarity index 96% rename from pkg/app/api/api/BUILD.bazel rename to pkg/app/api/grpcapi/BUILD.bazel index c4e52e951f..39823eb7c1 100644 --- a/pkg/app/api/api/BUILD.bazel +++ b/pkg/app/api/grpcapi/BUILD.bazel @@ -9,7 +9,7 @@ go_library( "web_api.go", ":deployment_config_templates.embed", #keep ], - importpath = "github.com/pipe-cd/pipe/pkg/app/api/api", + importpath = "github.com/pipe-cd/pipe/pkg/app/api/grpcapi", visibility = ["//visibility:public"], deps = [ "//pkg/app/api/applicationlivestatestore:go_default_library", @@ -59,7 +59,7 @@ go_embed_data( name = "deployment_config_templates.embed", srcs = glob(["deploymentconfigtemplates/*"]), flatten = True, - package = "api", + package = "grpcapi", string = True, var = "DeploymentConfigTemplates", visibility = ["//visibility:public"], diff --git a/pkg/app/api/api/deployment_config_templates.go b/pkg/app/api/grpcapi/deployment_config_templates.go similarity index 99% rename from pkg/app/api/api/deployment_config_templates.go rename to pkg/app/api/grpcapi/deployment_config_templates.go index 9164cf5765..b60fee7078 100644 --- a/pkg/app/api/api/deployment_config_templates.go +++ b/pkg/app/api/grpcapi/deployment_config_templates.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package api +package grpcapi import ( "github.com/pipe-cd/pipe/pkg/app/api/service/webservice" diff --git a/pkg/app/api/api/deploymentconfigtemplates/KubernetesBlueGreen b/pkg/app/api/grpcapi/deploymentconfigtemplates/KubernetesBlueGreen similarity index 100% rename from pkg/app/api/api/deploymentconfigtemplates/KubernetesBlueGreen rename to pkg/app/api/grpcapi/deploymentconfigtemplates/KubernetesBlueGreen diff --git a/pkg/app/api/api/deploymentconfigtemplates/KubernetesCanary b/pkg/app/api/grpcapi/deploymentconfigtemplates/KubernetesCanary similarity index 100% rename from pkg/app/api/api/deploymentconfigtemplates/KubernetesCanary rename to pkg/app/api/grpcapi/deploymentconfigtemplates/KubernetesCanary diff --git a/pkg/app/api/api/deploymentconfigtemplates/KubernetesKustomize b/pkg/app/api/grpcapi/deploymentconfigtemplates/KubernetesKustomize similarity index 100% rename from pkg/app/api/api/deploymentconfigtemplates/KubernetesKustomize rename to pkg/app/api/grpcapi/deploymentconfigtemplates/KubernetesKustomize diff --git a/pkg/app/api/api/deploymentconfigtemplates/KubernetesSimple b/pkg/app/api/grpcapi/deploymentconfigtemplates/KubernetesSimple similarity index 100% rename from pkg/app/api/api/deploymentconfigtemplates/KubernetesSimple rename to pkg/app/api/grpcapi/deploymentconfigtemplates/KubernetesSimple diff --git a/pkg/app/api/api/fake_web_api.go b/pkg/app/api/grpcapi/fake_web_api.go similarity index 99% rename from pkg/app/api/api/fake_web_api.go rename to pkg/app/api/grpcapi/fake_web_api.go index 38635c2787..9c51c5fd63 100644 --- a/pkg/app/api/api/fake_web_api.go +++ b/pkg/app/api/grpcapi/fake_web_api.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package api +package grpcapi import ( "context" diff --git a/pkg/app/api/api/piped_api.go b/pkg/app/api/grpcapi/piped_api.go similarity index 99% rename from pkg/app/api/api/piped_api.go rename to pkg/app/api/grpcapi/piped_api.go index f64edcb9e0..b8593aca0a 100644 --- a/pkg/app/api/api/piped_api.go +++ b/pkg/app/api/grpcapi/piped_api.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package api +package grpcapi import ( "context" diff --git a/pkg/app/api/api/piped_api_test.go b/pkg/app/api/grpcapi/piped_api_test.go similarity index 99% rename from pkg/app/api/api/piped_api_test.go rename to pkg/app/api/grpcapi/piped_api_test.go index e422b4857e..566cd7ef9a 100644 --- a/pkg/app/api/api/piped_api_test.go +++ b/pkg/app/api/grpcapi/piped_api_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package api +package grpcapi import ( "context" diff --git a/pkg/app/api/api/web_api.go b/pkg/app/api/grpcapi/web_api.go similarity index 99% rename from pkg/app/api/api/web_api.go rename to pkg/app/api/grpcapi/web_api.go index 8d01910e72..fc494a0106 100644 --- a/pkg/app/api/api/web_api.go +++ b/pkg/app/api/grpcapi/web_api.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package api +package grpcapi import ( "context" diff --git a/pkg/app/api/api/web_api_test.go b/pkg/app/api/grpcapi/web_api_test.go similarity index 99% rename from pkg/app/api/api/web_api_test.go rename to pkg/app/api/grpcapi/web_api_test.go index ab3671a73c..58baa6ad30 100644 --- a/pkg/app/api/api/web_api_test.go +++ b/pkg/app/api/grpcapi/web_api_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package api +package grpcapi import ( "context"