From 67415dc4f6f293460517d4281b5e4e80e66ffb91 Mon Sep 17 00:00:00 2001 From: feistel <6742251-feistel@users.noreply.gitlab.com> Date: Wed, 8 Sep 2021 14:40:35 +0000 Subject: refactor: rearchitect command and executable Go modules --- cmd/check/command/command.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 cmd/check/command/command.go (limited to 'cmd/check/command/command.go') diff --git a/cmd/check/command/command.go b/cmd/check/command/command.go new file mode 100644 index 0000000..e72f792 --- /dev/null +++ b/cmd/check/command/command.go @@ -0,0 +1,22 @@ +package command + +import ( + "gitlab.com/gitlab-org/gitlab-shell/internal/command" + "gitlab.com/gitlab-org/gitlab-shell/internal/command/healthcheck" + "gitlab.com/gitlab-org/gitlab-shell/internal/command/readwriter" + "gitlab.com/gitlab-org/gitlab-shell/internal/command/shared/disallowedcommand" + "gitlab.com/gitlab-org/gitlab-shell/internal/config" +) + + +func New(config *config.Config, readWriter *readwriter.ReadWriter) (command.Command, error) { + if cmd := build(config, readWriter); cmd != nil { + return cmd, nil + } + + return nil, disallowedcommand.Error +} + +func build(config *config.Config, readWriter *readwriter.ReadWriter) command.Command { + return &healthcheck.Command{Config: config, ReadWriter: readWriter} +} -- cgit v1.2.1