From 1745afd0ca16c2aec0274817a7ee999fe266c381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Barroso?= Date: Thu, 16 Jan 2025 12:16:29 +0100 Subject: [PATCH] feat: add pipelines ls cmd (+client API) (#2063) * rename pkg name * feat: add pipelines ls * pipeline ls work * hide processors for now * include alias for pipelines cmd * hide columns for now We'll augment these on pipeline describe and see how it feels * fix api flags (+test) * use pipeline service directly * update flag names * remove testing boolean * add ExecuteWithClient decorator * fix double conn err msg * better approach * include comment * read from the same addresss * fix ci * fix ci II * fix tests * pipelines ls with config * uses ecdysis parsing * fix ci * remove test * return default value in case it's not parsed * give additional context if there's an error * early return * fix lint --- cmd/conduit/api/client.go | 68 +++++++++++ cmd/conduit/cecdysis/decorators.go | 106 ++++++++++++++++++ cmd/conduit/main.go | 3 +- cmd/conduit/root/config/config_test.go | 4 +- cmd/conduit/root/pipelines/list.go | 89 +++++++++++++++ cmd/conduit/root/pipelines/pipelines.go | 4 + cmd/conduit/root/root.go | 6 +- cmd/conduit/root/root_test.go | 2 + cmd/conduit/root/run/run.go | 11 +- cmd/conduit/root/run/run_test.go | 4 +- go.mod | 3 +- go.sum | 4 + pkg/conduit/config.go | 77 +++++++------ pkg/conduit/config_test.go | 4 +- pkg/conduit/runtime.go | 4 +- pkg/{web => http}/api/connector_v1.go | 6 +- pkg/{web => http}/api/connector_v1_test.go | 4 +- pkg/{web => http}/api/fromproto/connector.go | 0 .../api/fromproto/connector_test.go | 0 pkg/{web => http}/api/fromproto/pipeline.go | 0 pkg/{web => http}/api/fromproto/processor.go | 0 pkg/{web => http}/api/health_server.go | 0 pkg/{web => http}/api/health_server_test.go | 0 pkg/{web => http}/api/info.go | 0 pkg/{web => http}/api/mock/connector.go | 2 +- .../api/mock/connector_plugin.go | 2 +- .../api/mock/connector_service.go | 0 pkg/{web => http}/api/mock/pipeline.go | 2 +- pkg/{web => http}/api/mock/processor.go | 2 +- .../api/mock/processor_plugin.go | 2 +- .../api/mock/processor_service_in.go | 0 .../api/mock/processor_service_out.go | 0 pkg/{web => http}/api/pipeline_v1.go | 6 +- pkg/{web => http}/api/pipeline_v1_test.go | 2 +- pkg/{web => http}/api/plugin_v1.go | 4 +- pkg/{web => http}/api/plugin_v1_test.go | 4 +- pkg/{web => http}/api/processor_v1.go | 6 +- pkg/{web => http}/api/processor_v1_test.go | 4 +- pkg/{web => http}/api/status/status.go | 0 pkg/{web => http}/api/status/status_test.go | 0 pkg/{web => http}/api/toproto/connector.go | 0 pkg/{web => http}/api/toproto/pipeline.go | 0 pkg/{web => http}/api/toproto/plugin.go | 0 pkg/{web => http}/api/toproto/processor.go | 0 pkg/{web => http}/openapi/README.md | 0 pkg/{web => http}/openapi/copy-swagger-api.sh | 0 pkg/{web => http}/openapi/openapi.go | 0 pkg/{web => http}/openapi/swagger-ui/LICENSE | 0 .../swagger-ui/api/v1/api.swagger.json | 0 .../openapi/swagger-ui/favicon-16x16.png | Bin .../openapi/swagger-ui/favicon-32x32.png | Bin .../openapi/swagger-ui/index.css | 0 .../openapi/swagger-ui/index.html | 0 .../openapi/swagger-ui/oauth2-redirect.html | 0 .../openapi/swagger-ui/swagger-initializer.js | 0 .../openapi/swagger-ui/swagger-ui-bundle.js | 0 .../swagger-ui/swagger-ui-es-bundle-core.js | 0 .../swagger-ui/swagger-ui-es-bundle.js | 0 .../swagger-ui-standalone-preset.js | 0 .../openapi/swagger-ui/swagger-ui.css | 0 .../openapi/swagger-ui/swagger-ui.js | 0 61 files changed, 360 insertions(+), 75 deletions(-) create mode 100644 cmd/conduit/api/client.go create mode 100644 cmd/conduit/cecdysis/decorators.go create mode 100644 cmd/conduit/root/pipelines/list.go rename pkg/{web => http}/api/connector_v1.go (97%) rename pkg/{web => http}/api/connector_v1_test.go (99%) rename pkg/{web => http}/api/fromproto/connector.go (100%) rename pkg/{web => http}/api/fromproto/connector_test.go (100%) rename pkg/{web => http}/api/fromproto/pipeline.go (100%) rename pkg/{web => http}/api/fromproto/processor.go (100%) rename pkg/{web => http}/api/health_server.go (100%) rename pkg/{web => http}/api/health_server_test.go (100%) rename pkg/{web => http}/api/info.go (100%) rename pkg/{web => http}/api/mock/connector.go (99%) rename pkg/{web => http}/api/mock/connector_plugin.go (96%) rename pkg/{web => http}/api/mock/connector_service.go (100%) rename pkg/{web => http}/api/mock/pipeline.go (99%) rename pkg/{web => http}/api/mock/processor.go (99%) rename pkg/{web => http}/api/mock/processor_plugin.go (96%) rename pkg/{web => http}/api/mock/processor_service_in.go (100%) rename pkg/{web => http}/api/mock/processor_service_out.go (100%) rename pkg/{web => http}/api/pipeline_v1.go (97%) rename pkg/{web => http}/api/pipeline_v1_test.go (98%) rename pkg/{web => http}/api/plugin_v1.go (95%) rename pkg/{web => http}/api/plugin_v1_test.go (96%) rename pkg/{web => http}/api/processor_v1.go (98%) rename pkg/{web => http}/api/processor_v1_test.go (99%) rename pkg/{web => http}/api/status/status.go (100%) rename pkg/{web => http}/api/status/status_test.go (100%) rename pkg/{web => http}/api/toproto/connector.go (100%) rename pkg/{web => http}/api/toproto/pipeline.go (100%) rename pkg/{web => http}/api/toproto/plugin.go (100%) rename pkg/{web => http}/api/toproto/processor.go (100%) rename pkg/{web => http}/openapi/README.md (100%) rename pkg/{web => http}/openapi/copy-swagger-api.sh (100%) rename pkg/{web => http}/openapi/openapi.go (100%) rename pkg/{web => http}/openapi/swagger-ui/LICENSE (100%) rename pkg/{web => http}/openapi/swagger-ui/api/v1/api.swagger.json (100%) rename pkg/{web => http}/openapi/swagger-ui/favicon-16x16.png (100%) rename pkg/{web => http}/openapi/swagger-ui/favicon-32x32.png (100%) rename pkg/{web => http}/openapi/swagger-ui/index.css (100%) rename pkg/{web => http}/openapi/swagger-ui/index.html (100%) rename pkg/{web => http}/openapi/swagger-ui/oauth2-redirect.html (100%) rename pkg/{web => http}/openapi/swagger-ui/swagger-initializer.js (100%) rename pkg/{web => http}/openapi/swagger-ui/swagger-ui-bundle.js (100%) rename pkg/{web => http}/openapi/swagger-ui/swagger-ui-es-bundle-core.js (100%) rename pkg/{web => http}/openapi/swagger-ui/swagger-ui-es-bundle.js (100%) rename pkg/{web => http}/openapi/swagger-ui/swagger-ui-standalone-preset.js (100%) rename pkg/{web => http}/openapi/swagger-ui/swagger-ui.css (100%) rename pkg/{web => http}/openapi/swagger-ui/swagger-ui.js (100%) diff --git a/cmd/conduit/api/client.go b/cmd/conduit/api/client.go new file mode 100644 index 000000000..8bc1f058e --- /dev/null +++ b/cmd/conduit/api/client.go @@ -0,0 +1,68 @@ +// Copyright © 2025 Meroxa, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package api + +import ( + "context" + "fmt" + + apiv1 "github.com/conduitio/conduit/proto/api/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" + healthgrpc "google.golang.org/grpc/health/grpc_health_v1" +) + +type Client struct { + conn *grpc.ClientConn + apiv1.PipelineServiceClient + healthgrpc.HealthClient +} + +func NewClient(ctx context.Context, address string) (*Client, error) { + conn, err := grpc.NewClient( + address, + grpc.WithTransportCredentials(insecure.NewCredentials()), + ) + if err != nil { + return nil, fmt.Errorf("failed to create gRPC client: %w", err) + } + + client := &Client{ + conn: conn, + PipelineServiceClient: apiv1.NewPipelineServiceClient(conn), + HealthClient: healthgrpc.NewHealthClient(conn), + } + + if err := client.CheckHealth(ctx, address); err != nil { + client.Close() + return nil, err + } + + return client, nil +} + +func (c *Client) CheckHealth(ctx context.Context, address string) error { + healthResp, err := c.HealthClient.Check(ctx, &healthgrpc.HealthCheckRequest{}) + if err != nil || healthResp.Status != healthgrpc.HealthCheckResponse_SERVING { + return fmt.Errorf("we couldn't connect to Conduit at the configured address %q\n"+ + "Please execute `conduit run` to start it.\nTo check the current configured `api.grpc.address`, run `conduit config`\n\n"+ + "Error details: %v", address, err) + } + return nil +} + +func (c *Client) Close() error { + return c.conn.Close() +} diff --git a/cmd/conduit/cecdysis/decorators.go b/cmd/conduit/cecdysis/decorators.go new file mode 100644 index 000000000..31a0e5853 --- /dev/null +++ b/cmd/conduit/cecdysis/decorators.go @@ -0,0 +1,106 @@ +// Copyright © 2025 Meroxa, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package cecdysis + +import ( + "context" + "fmt" + "os" + "path/filepath" + + "github.com/conduitio/conduit/cmd/conduit/api" + "github.com/conduitio/conduit/pkg/conduit" + "github.com/conduitio/ecdysis" + "github.com/spf13/cobra" +) + +// ------------------- CommandWithClient + +// CommandWithExecuteWithClient can be implemented by a command that requires a client to interact +// with the Conduit API during the execution. +type CommandWithExecuteWithClient interface { + ecdysis.Command + + // ExecuteWithClient is the actual work function. Most commands will implement this. + ExecuteWithClient(context.Context, *api.Client) error +} + +// CommandWithExecuteWithClientDecorator is a decorator that adds a Conduit API client to the command execution. +type CommandWithExecuteWithClientDecorator struct{} + +func (CommandWithExecuteWithClientDecorator) Decorate(_ *ecdysis.Ecdysis, cmd *cobra.Command, c ecdysis.Command) error { + v, ok := c.(CommandWithExecuteWithClient) + if !ok { + return nil + } + + old := cmd.RunE + cmd.RunE = func(cmd *cobra.Command, args []string) error { + if old != nil { + err := old(cmd, args) + if err != nil { + return err + } + } + + grpcAddress, err := getGRPCAddress(cmd) + if err != nil { + return fmt.Errorf("error reading gRPC address: %w", err) + } + + client, err := api.NewClient(cmd.Context(), grpcAddress) + if err != nil { + // Not an error we need to escalate to the main CLI execution. We'll print it out and not execute further. + _, _ = fmt.Fprintf(os.Stderr, "%v\n", err) + return nil + } + defer client.Close() + + ctx := ecdysis.ContextWithCobraCommand(cmd.Context(), cmd) + return v.ExecuteWithClient(ctx, client) + } + + return nil +} + +func getGRPCAddress(cmd *cobra.Command) (string, error) { + var ( + path string + err error + ) + + path, err = cmd.Flags().GetString("config.path") + if err != nil || path == "" { + path = conduit.DefaultConfig().ConduitCfgPath + } + + var usrCfg conduit.Config + defaultConfigValues := conduit.DefaultConfigWithBasePath(filepath.Dir(path)) + + cfg := ecdysis.Config{ + EnvPrefix: "CONDUIT", + Parsed: &usrCfg, + Path: path, + DefaultValues: defaultConfigValues, + } + + // If it can't be parsed, we return the default value + err = ecdysis.ParseConfig(cfg, cmd) + if err != nil || usrCfg.API.GRPC.Address == "" { + return defaultConfigValues.API.GRPC.Address, nil + } + + return usrCfg.API.GRPC.Address, nil +} diff --git a/cmd/conduit/main.go b/cmd/conduit/main.go index 0a28295a6..55ccc53f0 100644 --- a/cmd/conduit/main.go +++ b/cmd/conduit/main.go @@ -18,12 +18,13 @@ import ( "fmt" "os" + "github.com/conduitio/conduit/cmd/conduit/cecdysis" "github.com/conduitio/conduit/cmd/conduit/root" "github.com/conduitio/ecdysis" ) func main() { - e := ecdysis.New() + e := ecdysis.New(ecdysis.WithDecorators(cecdysis.CommandWithExecuteWithClientDecorator{})) cmd := e.MustBuildCobraCommand(&root.RootCommand{}) cmd.CompletionOptions.DisableDefaultCmd = true diff --git a/cmd/conduit/root/config/config_test.go b/cmd/conduit/root/config/config_test.go index bd410949b..aa65d0153 100644 --- a/cmd/conduit/root/config/config_test.go +++ b/cmd/conduit/root/config/config_test.go @@ -56,8 +56,8 @@ func TestPrintStructOutput(t *testing.T) { "db.postgres.table: conduit_kv_store", "db.sqlite.table: conduit_kv_store", "api.enabled: true", - "http.address: :8080", - "grpc.address: :8084", + "api.http.address: :8080", + "api.grpc.address: :8084", "log.level: info", "log.format: cli", "pipelines.exit-on-degraded: false", diff --git a/cmd/conduit/root/pipelines/list.go b/cmd/conduit/root/pipelines/list.go new file mode 100644 index 000000000..4e794b019 --- /dev/null +++ b/cmd/conduit/root/pipelines/list.go @@ -0,0 +1,89 @@ +// Copyright © 2025 Meroxa, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package pipelines + +import ( + "context" + "fmt" + + "github.com/alexeyco/simpletable" + "github.com/conduitio/conduit/cmd/conduit/api" + "github.com/conduitio/conduit/cmd/conduit/cecdysis" + apiv1 "github.com/conduitio/conduit/proto/api/v1" + "github.com/conduitio/ecdysis" +) + +var ( + _ cecdysis.CommandWithExecuteWithClient = (*ListCommand)(nil) + _ ecdysis.CommandWithAliases = (*ListCommand)(nil) + _ ecdysis.CommandWithDocs = (*ListCommand)(nil) +) + +type ListCommand struct{} + +func (c *ListCommand) Docs() ecdysis.Docs { + return ecdysis.Docs{ + Short: "List existing Conduit pipelines", + Long: `This command requires Conduit to be already running since it will list all pipelines registered +by Conduit. This will depend on the configured pipelines directory, which by default is /pipelines; however, it could +be configured via --pipelines.path at the time of running Conduit.`, + Example: "conduit pipelines ls", + } +} + +func (c *ListCommand) Aliases() []string { return []string{"ls"} } + +func (c *ListCommand) Usage() string { return "list" } + +func (c *ListCommand) ExecuteWithClient(ctx context.Context, client *api.Client) error { + resp, err := client.PipelineServiceClient.ListPipelines(ctx, &apiv1.ListPipelinesRequest{}) + if err != nil { + return fmt.Errorf("failed to list pipelines: %w", err) + } + + displayPipelines(resp.Pipelines) + + return nil +} + +func displayPipelines(pipelines []*apiv1.Pipeline) { + if len(pipelines) == 0 { + return + } + + table := simpletable.New() + + table.Header = &simpletable.Header{ + Cells: []*simpletable.Cell{ + {Align: simpletable.AlignCenter, Text: "ID"}, + {Align: simpletable.AlignCenter, Text: "STATE"}, + {Align: simpletable.AlignCenter, Text: "CREATED"}, + {Align: simpletable.AlignCenter, Text: "LAST_UPDATED"}, + }, + } + + for _, p := range pipelines { + r := []*simpletable.Cell{ + {Align: simpletable.AlignRight, Text: p.Id}, + {Align: simpletable.AlignLeft, Text: p.State.Status.String()}, + {Align: simpletable.AlignLeft, Text: p.CreatedAt.AsTime().String()}, + {Align: simpletable.AlignLeft, Text: p.UpdatedAt.AsTime().String()}, + } + + table.Body.Cells = append(table.Body.Cells, r) + } + table.SetStyle(simpletable.StyleCompact) + fmt.Println(table.String()) +} diff --git a/cmd/conduit/root/pipelines/pipelines.go b/cmd/conduit/root/pipelines/pipelines.go index 62dbcc91d..0ae75ea5f 100644 --- a/cmd/conduit/root/pipelines/pipelines.go +++ b/cmd/conduit/root/pipelines/pipelines.go @@ -21,13 +21,17 @@ import ( var ( _ ecdysis.CommandWithDocs = (*PipelinesCommand)(nil) _ ecdysis.CommandWithSubCommands = (*PipelinesCommand)(nil) + _ ecdysis.CommandWithAliases = (*PipelinesCommand)(nil) ) type PipelinesCommand struct{} +func (c *PipelinesCommand) Aliases() []string { return []string{"pipeline"} } + func (c *PipelinesCommand) SubCommands() []ecdysis.Command { return []ecdysis.Command{ &InitCommand{}, + &ListCommand{}, } } diff --git a/cmd/conduit/root/root.go b/cmd/conduit/root/root.go index d3cd49a06..ecfa2dd0f 100644 --- a/cmd/conduit/root/root.go +++ b/cmd/conduit/root/root.go @@ -37,6 +37,10 @@ var ( type RootFlags struct { Version bool `long:"version" short:"v" usage:"show the current Conduit version"` + + // Global Flags + GRPCAddress string `long:"api.grpc.address" usage:"address where Conduit is running" persistent:"true"` + ConfigPath string `long:"config.path" usage:"path to the configuration file" persistent:"true"` } type RootCommand struct { @@ -77,6 +81,6 @@ func (c *RootCommand) SubCommands() []ecdysis.Command { &initialize.InitCommand{Cfg: &runCmd.Cfg}, &version.VersionCommand{}, &pipelines.PipelinesCommand{}, - &run.RunCommand{}, + runCmd, } } diff --git a/cmd/conduit/root/root_test.go b/cmd/conduit/root/root_test.go index 7188667ea..e522b1919 100644 --- a/cmd/conduit/root/root_test.go +++ b/cmd/conduit/root/root_test.go @@ -32,6 +32,8 @@ func TestRootCommandFlags(t *testing.T) { persistent bool }{ {longName: "version", shortName: "v", usage: "show the current Conduit version"}, + {longName: "api.grpc.address", usage: "address where Conduit is running", persistent: true}, + {longName: "config.path", usage: "path to the configuration file", persistent: true}, } e := ecdysis.New() diff --git a/cmd/conduit/root/run/run.go b/cmd/conduit/root/run/run.go index 4ec8ee877..0dd030650 100644 --- a/cmd/conduit/root/run/run.go +++ b/cmd/conduit/root/run/run.go @@ -16,6 +16,7 @@ package run import ( "context" + "fmt" "os" "path/filepath" @@ -42,6 +43,12 @@ type RunCommand struct { func (c *RunCommand) Execute(_ context.Context) error { e := &conduit.Entrypoint{} + + if !c.Cfg.API.Enabled { + fmt.Print("Warning: API is currently disabled. Most Conduit CLI commands won't work without the API enabled." + + "To enable it, run conduit with `--api.enabled=true` or set `CONDUIT_API_ENABLED=true` in your environment.") + } + e.Serve(c.Cfg) return nil } @@ -76,8 +83,8 @@ func (c *RunCommand) Flags() []ecdysis.Flag { flags.SetDefault("db.sqlite.path", c.Cfg.DB.SQLite.Path) flags.SetDefault("db.sqlite.table", c.Cfg.DB.SQLite.Table) flags.SetDefault("api.enabled", c.Cfg.API.Enabled) - flags.SetDefault("http.address", c.Cfg.API.HTTP.Address) - flags.SetDefault("grpc.address", c.Cfg.API.GRPC.Address) + flags.SetDefault("api.http.address", c.Cfg.API.HTTP.Address) + flags.SetDefault("api.grpc.address", c.Cfg.API.GRPC.Address) flags.SetDefault("log.level", c.Cfg.Log.Level) flags.SetDefault("log.format", c.Cfg.Log.Format) flags.SetDefault("connectors.path", c.Cfg.Connectors.Path) diff --git a/cmd/conduit/root/run/run_test.go b/cmd/conduit/root/run/run_test.go index 09f197617..535bc8561 100644 --- a/cmd/conduit/root/run/run_test.go +++ b/cmd/conduit/root/run/run_test.go @@ -39,8 +39,8 @@ func TestRunCommandFlags(t *testing.T) { {longName: "db.sqlite.path", usage: "path to sqlite3 DB"}, {longName: "db.sqlite.table", usage: "sqlite3 table in which to store data (will be created if it does not exist)"}, {longName: "api.enabled", usage: "enable HTTP and gRPC API"}, - {longName: "http.address", usage: "address for serving the HTTP API"}, - {longName: "grpc.address", usage: "address for serving the gRPC API"}, + {longName: "api.http.address", usage: "address for serving the HTTP API"}, + {longName: "api.grpc.address", usage: "address for serving the gRPC API"}, {longName: "log.level", usage: "sets logging level; accepts debug, info, warn, error, trace"}, {longName: "log.format", usage: "sets the format of the logging; accepts json, cli"}, {longName: "connectors.path", usage: "path to standalone connectors' directory"}, diff --git a/go.mod b/go.mod index 32499d47a..2085141c3 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ require ( buf.build/gen/go/grpc-ecosystem/grpc-gateway/protocolbuffers/go v1.36.3-20241220201140-4c5ba75caaf8.1 github.com/Masterminds/semver/v3 v3.3.1 github.com/Masterminds/sprig/v3 v3.3.0 + github.com/alexeyco/simpletable v1.0.0 github.com/bufbuild/buf v1.49.0 github.com/conduitio/conduit-commons v0.5.0 github.com/conduitio/conduit-connector-file v0.9.0 @@ -40,6 +41,7 @@ require ( github.com/prometheus/common v0.61.0 github.com/rs/zerolog v1.33.0 github.com/sourcegraph/conc v0.3.0 + github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 github.com/stealthrocket/wazergo v0.19.1 github.com/tetratelabs/wazero v1.8.2 @@ -322,7 +324,6 @@ require ( github.com/sourcegraph/go-diff v0.7.0 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.7.0 // indirect - github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/viper v1.19.0 // indirect github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect github.com/stbenjam/no-sprintf-host-port v0.2.0 // indirect diff --git a/go.sum b/go.sum index 5f819a890..639d90ff9 100644 --- a/go.sum +++ b/go.sum @@ -102,6 +102,8 @@ github.com/alecthomas/go-check-sumtype v0.3.1 h1:u9aUvbGINJxLVXiFvHUlPEaD7VDULsr github.com/alecthomas/go-check-sumtype v0.3.1/go.mod h1:A8TSiN3UPRw3laIgWEUOHHLPa6/r9MtoigdlP5h3K/E= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= +github.com/alexeyco/simpletable v1.0.0 h1:ZQ+LvJ4bmoeHb+dclF64d0LX+7QAi7awsfCrptZrpHk= +github.com/alexeyco/simpletable v1.0.0/go.mod h1:VJWVTtGUnW7EKbMRH8cE13SigKGx/1fO2SeeOiGeBkk= github.com/alexkohler/nakedret/v2 v2.0.5 h1:fP5qLgtwbx9EJE8dGEERT02YwS8En4r9nnZ71RK+EVU= github.com/alexkohler/nakedret/v2 v2.0.5/go.mod h1:bF5i0zF2Wo2o4X4USt9ntUWve6JbFv02Ff4vlkmS/VU= github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pOcUuw= @@ -645,6 +647,7 @@ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mgechev/revive v1.5.1 h1:hE+QPeq0/wIzJwOphdVyUJ82njdd8Khp4fUIHGZHW3M= @@ -773,6 +776,7 @@ github.com/raeperd/recvcheck v0.2.0 h1:GnU+NsbiCqdC2XX5+vMZzP+jAJC5fht7rcVTAhX74 github.com/raeperd/recvcheck v0.2.0/go.mod h1:n04eYkwIR0JbgD73wT8wL4JjPC3wm0nFtzBnWNocnYU= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= diff --git a/pkg/conduit/config.go b/pkg/conduit/config.go index 7c14e0621..45442ecb1 100644 --- a/pkg/conduit/config.go +++ b/pkg/conduit/config.go @@ -39,47 +39,46 @@ const ( SchemaRegistryTypeBuiltin = "builtin" ) -type ConfigDB struct { - // When Driver is specified it takes precedence over other DB related - // fields. - Driver database.DB - - Type string `long:"db.type" usage:"database type; accepts badger,postgres,inmemory,sqlite"` - Badger struct { - Path string `long:"db.badger.path" usage:"path to badger DB"` - } - Postgres struct { - ConnectionString string `long:"db.postgres.connection-string" usage:"postgres connection string, may be a database URL or in PostgreSQL keyword/value format"` - Table string `long:"db.postgres.table" usage:"postgres table in which to store data (will be created if it does not exist)"` - } - SQLite struct { - Path string `long:"db.sqlite.path" usage:"path to sqlite3 DB"` - Table string `long:"db.sqlite.table" usage:"sqlite3 table in which to store data (will be created if it does not exist)"` - } -} +// Config holds all configurable values for Conduit. +type Config struct { + ConduitCfgPath string `long:"config.path" usage:"global conduit configuration file" default:"./conduit.yaml"` -type ConfigAPI struct { - Enabled bool `long:"api.enabled" usage:"enable HTTP and gRPC API"` - HTTP struct { - Address string `long:"http.address" usage:"address for serving the HTTP API"` - } - GRPC struct { - Address string `long:"grpc.address" usage:"address for serving the gRPC API"` + DB struct { + // When Driver is specified it takes precedence over other DB related + // fields. + Driver database.DB + + Type string `long:"db.type" usage:"database type; accepts badger,postgres,inmemory,sqlite"` + Badger struct { + Path string `long:"db.badger.path" usage:"path to badger DB"` + } + Postgres struct { + ConnectionString string `long:"db.postgres.connection-string" usage:"postgres connection string, may be a database URL or in PostgreSQL keyword/value format"` + Table string `long:"db.postgres.table" usage:"postgres table in which to store data (will be created if it does not exist)"` + } + SQLite struct { + Path string `long:"db.sqlite.path" usage:"path to sqlite3 DB"` + Table string `long:"db.sqlite.table" usage:"sqlite3 table in which to store data (will be created if it does not exist)"` + } } -} -type ConfigLog struct { - NewLogger func(level, format string) log.CtxLogger - Level string `long:"log.level" usage:"sets logging level; accepts debug, info, warn, error, trace"` - Format string `long:"log.format" usage:"sets the format of the logging; accepts json, cli"` -} + API struct { + Enabled bool `long:"api.enabled" usage:"enable HTTP and gRPC API"` + HTTP struct { + Address string `long:"api.http.address" usage:"address for serving the HTTP API"` + } + GRPC struct { + // This is the address where the gRPC API will be served which is shared as a global flag + // for the Conduit CLI. + Address string `long:"api.grpc.address" usage:"address for serving the gRPC API"` + } + } -// Config holds all configurable values for Conduit. -type Config struct { - ConduitCfgPath string `long:"config.path" usage:"global conduit configuration file" default:"./conduit.yaml"` - DB ConfigDB - API ConfigAPI - Log ConfigLog + Log struct { + NewLogger func(level, format string) log.CtxLogger + Level string `long:"log.level" usage:"sets logging level; accepts debug, info, warn, error, trace"` + Format string `long:"log.format" usage:"sets the format of the logging; accepts json, cli"` + } Connectors struct { Path string `long:"connectors.path" usage:"path to standalone connectors' directory"` @@ -256,10 +255,10 @@ func (c Config) Validate() error { if c.API.Enabled { if c.API.GRPC.Address == "" { - return requiredConfigFieldErr("grpc.address") + return requiredConfigFieldErr("api.grpc.address") } if c.API.HTTP.Address == "" { - return requiredConfigFieldErr("http.address") + return requiredConfigFieldErr("api.http.address") } } diff --git a/pkg/conduit/config_test.go b/pkg/conduit/config_test.go index b1026a26b..f01b5f1aa 100644 --- a/pkg/conduit/config_test.go +++ b/pkg/conduit/config_test.go @@ -95,7 +95,7 @@ func TestConfig_Validate(t *testing.T) { c.API.HTTP.Address = "" return c }, - want: requiredConfigFieldErr("http.address"), + want: requiredConfigFieldErr("api.http.address"), }, { name: "required GRPC address", @@ -103,7 +103,7 @@ func TestConfig_Validate(t *testing.T) { c.API.GRPC.Address = "" return c }, - want: requiredConfigFieldErr("grpc.address"), + want: requiredConfigFieldErr("api.grpc.address"), }, { name: "disabled API valid", diff --git a/pkg/conduit/runtime.go b/pkg/conduit/runtime.go index 168d78003..dddc83422 100644 --- a/pkg/conduit/runtime.go +++ b/pkg/conduit/runtime.go @@ -45,6 +45,8 @@ import ( "github.com/conduitio/conduit/pkg/foundation/metrics" "github.com/conduitio/conduit/pkg/foundation/metrics/measure" "github.com/conduitio/conduit/pkg/foundation/metrics/prometheus" + "github.com/conduitio/conduit/pkg/http/api" + "github.com/conduitio/conduit/pkg/http/openapi" "github.com/conduitio/conduit/pkg/lifecycle" lifecycle_v2 "github.com/conduitio/conduit/pkg/lifecycle-poc" "github.com/conduitio/conduit/pkg/orchestrator" @@ -60,8 +62,6 @@ import ( "github.com/conduitio/conduit/pkg/processor" "github.com/conduitio/conduit/pkg/provisioning" "github.com/conduitio/conduit/pkg/schemaregistry" - "github.com/conduitio/conduit/pkg/web/api" - "github.com/conduitio/conduit/pkg/web/openapi" apiv1 "github.com/conduitio/conduit/proto/api/v1" grpcruntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/piotrkowalczuk/promgrpc/v4" diff --git a/pkg/web/api/connector_v1.go b/pkg/http/api/connector_v1.go similarity index 97% rename from pkg/web/api/connector_v1.go rename to pkg/http/api/connector_v1.go index 2a4dde881..50e2f6c45 100644 --- a/pkg/web/api/connector_v1.go +++ b/pkg/http/api/connector_v1.go @@ -26,10 +26,10 @@ import ( "github.com/conduitio/conduit-connector-protocol/pconnector" "github.com/conduitio/conduit/pkg/connector" "github.com/conduitio/conduit/pkg/foundation/cerrors" + "github.com/conduitio/conduit/pkg/http/api/fromproto" + "github.com/conduitio/conduit/pkg/http/api/status" + "github.com/conduitio/conduit/pkg/http/api/toproto" "github.com/conduitio/conduit/pkg/inspector" - "github.com/conduitio/conduit/pkg/web/api/fromproto" - "github.com/conduitio/conduit/pkg/web/api/status" - "github.com/conduitio/conduit/pkg/web/api/toproto" apiv1 "github.com/conduitio/conduit/proto/api/v1" "google.golang.org/grpc" ) diff --git a/pkg/web/api/connector_v1_test.go b/pkg/http/api/connector_v1_test.go similarity index 99% rename from pkg/web/api/connector_v1_test.go rename to pkg/http/api/connector_v1_test.go index 3a4a54db8..c74fe9312 100644 --- a/pkg/web/api/connector_v1_test.go +++ b/pkg/http/api/connector_v1_test.go @@ -28,9 +28,9 @@ import ( "github.com/conduitio/conduit/pkg/connector" "github.com/conduitio/conduit/pkg/foundation/cerrors" "github.com/conduitio/conduit/pkg/foundation/log" + apimock "github.com/conduitio/conduit/pkg/http/api/mock" + "github.com/conduitio/conduit/pkg/http/api/toproto" "github.com/conduitio/conduit/pkg/inspector" - apimock "github.com/conduitio/conduit/pkg/web/api/mock" - "github.com/conduitio/conduit/pkg/web/api/toproto" apiv1 "github.com/conduitio/conduit/proto/api/v1" "github.com/google/uuid" "github.com/matryer/is" diff --git a/pkg/web/api/fromproto/connector.go b/pkg/http/api/fromproto/connector.go similarity index 100% rename from pkg/web/api/fromproto/connector.go rename to pkg/http/api/fromproto/connector.go diff --git a/pkg/web/api/fromproto/connector_test.go b/pkg/http/api/fromproto/connector_test.go similarity index 100% rename from pkg/web/api/fromproto/connector_test.go rename to pkg/http/api/fromproto/connector_test.go diff --git a/pkg/web/api/fromproto/pipeline.go b/pkg/http/api/fromproto/pipeline.go similarity index 100% rename from pkg/web/api/fromproto/pipeline.go rename to pkg/http/api/fromproto/pipeline.go diff --git a/pkg/web/api/fromproto/processor.go b/pkg/http/api/fromproto/processor.go similarity index 100% rename from pkg/web/api/fromproto/processor.go rename to pkg/http/api/fromproto/processor.go diff --git a/pkg/web/api/health_server.go b/pkg/http/api/health_server.go similarity index 100% rename from pkg/web/api/health_server.go rename to pkg/http/api/health_server.go diff --git a/pkg/web/api/health_server_test.go b/pkg/http/api/health_server_test.go similarity index 100% rename from pkg/web/api/health_server_test.go rename to pkg/http/api/health_server_test.go diff --git a/pkg/web/api/info.go b/pkg/http/api/info.go similarity index 100% rename from pkg/web/api/info.go rename to pkg/http/api/info.go diff --git a/pkg/web/api/mock/connector.go b/pkg/http/api/mock/connector.go similarity index 99% rename from pkg/web/api/mock/connector.go rename to pkg/http/api/mock/connector.go index a8e18b688..b95cfe699 100644 --- a/pkg/web/api/mock/connector.go +++ b/pkg/http/api/mock/connector.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/conduitio/conduit/pkg/web/api (interfaces: ConnectorOrchestrator) +// Source: github.com/conduitio/conduit/pkg/http/api (interfaces: ConnectorOrchestrator) // // Generated by this command: // diff --git a/pkg/web/api/mock/connector_plugin.go b/pkg/http/api/mock/connector_plugin.go similarity index 96% rename from pkg/web/api/mock/connector_plugin.go rename to pkg/http/api/mock/connector_plugin.go index b378b8756..3fde300e4 100644 --- a/pkg/web/api/mock/connector_plugin.go +++ b/pkg/http/api/mock/connector_plugin.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/conduitio/conduit/pkg/web/api (interfaces: ConnectorPluginOrchestrator) +// Source: github.com/conduitio/conduit/pkg/http/api (interfaces: ConnectorPluginOrchestrator) // // Generated by this command: // diff --git a/pkg/web/api/mock/connector_service.go b/pkg/http/api/mock/connector_service.go similarity index 100% rename from pkg/web/api/mock/connector_service.go rename to pkg/http/api/mock/connector_service.go diff --git a/pkg/web/api/mock/pipeline.go b/pkg/http/api/mock/pipeline.go similarity index 99% rename from pkg/web/api/mock/pipeline.go rename to pkg/http/api/mock/pipeline.go index 12d8b78cf..67bc7282e 100644 --- a/pkg/web/api/mock/pipeline.go +++ b/pkg/http/api/mock/pipeline.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/conduitio/conduit/pkg/web/api (interfaces: PipelineOrchestrator) +// Source: github.com/conduitio/conduit/pkg/http/api (interfaces: PipelineOrchestrator) // // Generated by this command: // diff --git a/pkg/web/api/mock/processor.go b/pkg/http/api/mock/processor.go similarity index 99% rename from pkg/web/api/mock/processor.go rename to pkg/http/api/mock/processor.go index 7e1fa50c1..4bbb58e0e 100644 --- a/pkg/web/api/mock/processor.go +++ b/pkg/http/api/mock/processor.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/conduitio/conduit/pkg/web/api (interfaces: ProcessorOrchestrator) +// Source: github.com/conduitio/conduit/pkg/http/api (interfaces: ProcessorOrchestrator) // // Generated by this command: // diff --git a/pkg/web/api/mock/processor_plugin.go b/pkg/http/api/mock/processor_plugin.go similarity index 96% rename from pkg/web/api/mock/processor_plugin.go rename to pkg/http/api/mock/processor_plugin.go index 8f1d52de3..7b0e20066 100644 --- a/pkg/web/api/mock/processor_plugin.go +++ b/pkg/http/api/mock/processor_plugin.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/conduitio/conduit/pkg/web/api (interfaces: ProcessorPluginOrchestrator) +// Source: github.com/conduitio/conduit/pkg/http/api (interfaces: ProcessorPluginOrchestrator) // // Generated by this command: // diff --git a/pkg/web/api/mock/processor_service_in.go b/pkg/http/api/mock/processor_service_in.go similarity index 100% rename from pkg/web/api/mock/processor_service_in.go rename to pkg/http/api/mock/processor_service_in.go diff --git a/pkg/web/api/mock/processor_service_out.go b/pkg/http/api/mock/processor_service_out.go similarity index 100% rename from pkg/web/api/mock/processor_service_out.go rename to pkg/http/api/mock/processor_service_out.go diff --git a/pkg/web/api/pipeline_v1.go b/pkg/http/api/pipeline_v1.go similarity index 97% rename from pkg/web/api/pipeline_v1.go rename to pkg/http/api/pipeline_v1.go index e0719cced..9521f2155 100644 --- a/pkg/web/api/pipeline_v1.go +++ b/pkg/http/api/pipeline_v1.go @@ -21,10 +21,10 @@ import ( "regexp" "github.com/conduitio/conduit/pkg/foundation/cerrors" + "github.com/conduitio/conduit/pkg/http/api/fromproto" + "github.com/conduitio/conduit/pkg/http/api/status" + "github.com/conduitio/conduit/pkg/http/api/toproto" "github.com/conduitio/conduit/pkg/pipeline" - "github.com/conduitio/conduit/pkg/web/api/fromproto" - "github.com/conduitio/conduit/pkg/web/api/status" - "github.com/conduitio/conduit/pkg/web/api/toproto" apiv1 "github.com/conduitio/conduit/proto/api/v1" "google.golang.org/grpc" ) diff --git a/pkg/web/api/pipeline_v1_test.go b/pkg/http/api/pipeline_v1_test.go similarity index 98% rename from pkg/web/api/pipeline_v1_test.go rename to pkg/http/api/pipeline_v1_test.go index 64c3fd060..5924dc230 100644 --- a/pkg/web/api/pipeline_v1_test.go +++ b/pkg/http/api/pipeline_v1_test.go @@ -19,8 +19,8 @@ import ( "sort" "testing" + "github.com/conduitio/conduit/pkg/http/api/mock" "github.com/conduitio/conduit/pkg/pipeline" - "github.com/conduitio/conduit/pkg/web/api/mock" apiv1 "github.com/conduitio/conduit/proto/api/v1" "github.com/google/uuid" "github.com/matryer/is" diff --git a/pkg/web/api/plugin_v1.go b/pkg/http/api/plugin_v1.go similarity index 95% rename from pkg/web/api/plugin_v1.go rename to pkg/http/api/plugin_v1.go index cbbd4af7b..f1b99fcde 100644 --- a/pkg/web/api/plugin_v1.go +++ b/pkg/http/api/plugin_v1.go @@ -19,8 +19,8 @@ import ( "regexp" "github.com/conduitio/conduit/pkg/foundation/cerrors" - "github.com/conduitio/conduit/pkg/web/api/status" - "github.com/conduitio/conduit/pkg/web/api/toproto" + "github.com/conduitio/conduit/pkg/http/api/status" + "github.com/conduitio/conduit/pkg/http/api/toproto" apiv1 "github.com/conduitio/conduit/proto/api/v1" "google.golang.org/grpc" ) diff --git a/pkg/web/api/plugin_v1_test.go b/pkg/http/api/plugin_v1_test.go similarity index 96% rename from pkg/web/api/plugin_v1_test.go rename to pkg/http/api/plugin_v1_test.go index e2e5e2a7e..9d0784151 100644 --- a/pkg/web/api/plugin_v1_test.go +++ b/pkg/http/api/plugin_v1_test.go @@ -21,8 +21,8 @@ import ( "github.com/conduitio/conduit-commons/config" "github.com/conduitio/conduit-connector-protocol/pconnector" - "github.com/conduitio/conduit/pkg/web/api/mock" - "github.com/conduitio/conduit/pkg/web/api/toproto" + "github.com/conduitio/conduit/pkg/http/api/mock" + "github.com/conduitio/conduit/pkg/http/api/toproto" apiv1 "github.com/conduitio/conduit/proto/api/v1" "github.com/matryer/is" "go.uber.org/mock/gomock" diff --git a/pkg/web/api/processor_v1.go b/pkg/http/api/processor_v1.go similarity index 98% rename from pkg/web/api/processor_v1.go rename to pkg/http/api/processor_v1.go index 6a1985723..ff0d5af9e 100644 --- a/pkg/web/api/processor_v1.go +++ b/pkg/http/api/processor_v1.go @@ -27,11 +27,11 @@ import ( opencdcv1 "github.com/conduitio/conduit-commons/proto/opencdc/v1" processorSdk "github.com/conduitio/conduit-processor-sdk" "github.com/conduitio/conduit/pkg/foundation/cerrors" + "github.com/conduitio/conduit/pkg/http/api/fromproto" + "github.com/conduitio/conduit/pkg/http/api/status" + "github.com/conduitio/conduit/pkg/http/api/toproto" "github.com/conduitio/conduit/pkg/inspector" "github.com/conduitio/conduit/pkg/processor" - "github.com/conduitio/conduit/pkg/web/api/fromproto" - "github.com/conduitio/conduit/pkg/web/api/status" - "github.com/conduitio/conduit/pkg/web/api/toproto" apiv1 "github.com/conduitio/conduit/proto/api/v1" "google.golang.org/grpc" ) diff --git a/pkg/web/api/processor_v1_test.go b/pkg/http/api/processor_v1_test.go similarity index 99% rename from pkg/web/api/processor_v1_test.go rename to pkg/http/api/processor_v1_test.go index bddcfbc6d..36afe5a99 100644 --- a/pkg/web/api/processor_v1_test.go +++ b/pkg/http/api/processor_v1_test.go @@ -27,10 +27,10 @@ import ( processorSdk "github.com/conduitio/conduit-processor-sdk" "github.com/conduitio/conduit/pkg/foundation/cerrors" "github.com/conduitio/conduit/pkg/foundation/log" + apimock "github.com/conduitio/conduit/pkg/http/api/mock" + "github.com/conduitio/conduit/pkg/http/api/toproto" "github.com/conduitio/conduit/pkg/inspector" "github.com/conduitio/conduit/pkg/processor" - apimock "github.com/conduitio/conduit/pkg/web/api/mock" - "github.com/conduitio/conduit/pkg/web/api/toproto" apiv1 "github.com/conduitio/conduit/proto/api/v1" "github.com/google/uuid" "github.com/matryer/is" diff --git a/pkg/web/api/status/status.go b/pkg/http/api/status/status.go similarity index 100% rename from pkg/web/api/status/status.go rename to pkg/http/api/status/status.go diff --git a/pkg/web/api/status/status_test.go b/pkg/http/api/status/status_test.go similarity index 100% rename from pkg/web/api/status/status_test.go rename to pkg/http/api/status/status_test.go diff --git a/pkg/web/api/toproto/connector.go b/pkg/http/api/toproto/connector.go similarity index 100% rename from pkg/web/api/toproto/connector.go rename to pkg/http/api/toproto/connector.go diff --git a/pkg/web/api/toproto/pipeline.go b/pkg/http/api/toproto/pipeline.go similarity index 100% rename from pkg/web/api/toproto/pipeline.go rename to pkg/http/api/toproto/pipeline.go diff --git a/pkg/web/api/toproto/plugin.go b/pkg/http/api/toproto/plugin.go similarity index 100% rename from pkg/web/api/toproto/plugin.go rename to pkg/http/api/toproto/plugin.go diff --git a/pkg/web/api/toproto/processor.go b/pkg/http/api/toproto/processor.go similarity index 100% rename from pkg/web/api/toproto/processor.go rename to pkg/http/api/toproto/processor.go diff --git a/pkg/web/openapi/README.md b/pkg/http/openapi/README.md similarity index 100% rename from pkg/web/openapi/README.md rename to pkg/http/openapi/README.md diff --git a/pkg/web/openapi/copy-swagger-api.sh b/pkg/http/openapi/copy-swagger-api.sh similarity index 100% rename from pkg/web/openapi/copy-swagger-api.sh rename to pkg/http/openapi/copy-swagger-api.sh diff --git a/pkg/web/openapi/openapi.go b/pkg/http/openapi/openapi.go similarity index 100% rename from pkg/web/openapi/openapi.go rename to pkg/http/openapi/openapi.go diff --git a/pkg/web/openapi/swagger-ui/LICENSE b/pkg/http/openapi/swagger-ui/LICENSE similarity index 100% rename from pkg/web/openapi/swagger-ui/LICENSE rename to pkg/http/openapi/swagger-ui/LICENSE diff --git a/pkg/web/openapi/swagger-ui/api/v1/api.swagger.json b/pkg/http/openapi/swagger-ui/api/v1/api.swagger.json similarity index 100% rename from pkg/web/openapi/swagger-ui/api/v1/api.swagger.json rename to pkg/http/openapi/swagger-ui/api/v1/api.swagger.json diff --git a/pkg/web/openapi/swagger-ui/favicon-16x16.png b/pkg/http/openapi/swagger-ui/favicon-16x16.png similarity index 100% rename from pkg/web/openapi/swagger-ui/favicon-16x16.png rename to pkg/http/openapi/swagger-ui/favicon-16x16.png diff --git a/pkg/web/openapi/swagger-ui/favicon-32x32.png b/pkg/http/openapi/swagger-ui/favicon-32x32.png similarity index 100% rename from pkg/web/openapi/swagger-ui/favicon-32x32.png rename to pkg/http/openapi/swagger-ui/favicon-32x32.png diff --git a/pkg/web/openapi/swagger-ui/index.css b/pkg/http/openapi/swagger-ui/index.css similarity index 100% rename from pkg/web/openapi/swagger-ui/index.css rename to pkg/http/openapi/swagger-ui/index.css diff --git a/pkg/web/openapi/swagger-ui/index.html b/pkg/http/openapi/swagger-ui/index.html similarity index 100% rename from pkg/web/openapi/swagger-ui/index.html rename to pkg/http/openapi/swagger-ui/index.html diff --git a/pkg/web/openapi/swagger-ui/oauth2-redirect.html b/pkg/http/openapi/swagger-ui/oauth2-redirect.html similarity index 100% rename from pkg/web/openapi/swagger-ui/oauth2-redirect.html rename to pkg/http/openapi/swagger-ui/oauth2-redirect.html diff --git a/pkg/web/openapi/swagger-ui/swagger-initializer.js b/pkg/http/openapi/swagger-ui/swagger-initializer.js similarity index 100% rename from pkg/web/openapi/swagger-ui/swagger-initializer.js rename to pkg/http/openapi/swagger-ui/swagger-initializer.js diff --git a/pkg/web/openapi/swagger-ui/swagger-ui-bundle.js b/pkg/http/openapi/swagger-ui/swagger-ui-bundle.js similarity index 100% rename from pkg/web/openapi/swagger-ui/swagger-ui-bundle.js rename to pkg/http/openapi/swagger-ui/swagger-ui-bundle.js diff --git a/pkg/web/openapi/swagger-ui/swagger-ui-es-bundle-core.js b/pkg/http/openapi/swagger-ui/swagger-ui-es-bundle-core.js similarity index 100% rename from pkg/web/openapi/swagger-ui/swagger-ui-es-bundle-core.js rename to pkg/http/openapi/swagger-ui/swagger-ui-es-bundle-core.js diff --git a/pkg/web/openapi/swagger-ui/swagger-ui-es-bundle.js b/pkg/http/openapi/swagger-ui/swagger-ui-es-bundle.js similarity index 100% rename from pkg/web/openapi/swagger-ui/swagger-ui-es-bundle.js rename to pkg/http/openapi/swagger-ui/swagger-ui-es-bundle.js diff --git a/pkg/web/openapi/swagger-ui/swagger-ui-standalone-preset.js b/pkg/http/openapi/swagger-ui/swagger-ui-standalone-preset.js similarity index 100% rename from pkg/web/openapi/swagger-ui/swagger-ui-standalone-preset.js rename to pkg/http/openapi/swagger-ui/swagger-ui-standalone-preset.js diff --git a/pkg/web/openapi/swagger-ui/swagger-ui.css b/pkg/http/openapi/swagger-ui/swagger-ui.css similarity index 100% rename from pkg/web/openapi/swagger-ui/swagger-ui.css rename to pkg/http/openapi/swagger-ui/swagger-ui.css diff --git a/pkg/web/openapi/swagger-ui/swagger-ui.js b/pkg/http/openapi/swagger-ui/swagger-ui.js similarity index 100% rename from pkg/web/openapi/swagger-ui/swagger-ui.js rename to pkg/http/openapi/swagger-ui/swagger-ui.js