From 66facde60aab5c0fa7c32e35b223405349906bd8 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Wed, 4 Sep 2019 10:18:30 +0200 Subject: [PATCH] Rename service package to command --- cmd/reva-phoenix/main.go | 4 ++-- pkg/{service/service.go => command/command.go} | 10 +++++----- pkg/{service => command}/defaults.go | 2 +- pkg/{service => command}/health.go | 6 +++--- pkg/{service => command}/server.go | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) rename pkg/{service/service.go => command/command.go} (92%) rename pkg/{service => command}/defaults.go (90%) rename pkg/{service => command}/health.go (82%) rename pkg/{service => command}/server.go (82%) diff --git a/cmd/reva-phoenix/main.go b/cmd/reva-phoenix/main.go index 78d190fe9e..1ae7c1c711 100644 --- a/cmd/reva-phoenix/main.go +++ b/cmd/reva-phoenix/main.go @@ -3,11 +3,11 @@ package main import ( "os" - "github.com/owncloud/reva-phoenix/pkg/service" + "github.com/owncloud/reva-phoenix/pkg/command" ) func main() { - if err := service.RootCommand().Execute(); err != nil { + if err := command.Root().Execute(); err != nil { os.Exit(1) } } diff --git a/pkg/service/service.go b/pkg/command/command.go similarity index 92% rename from pkg/service/service.go rename to pkg/command/command.go index 56046c5f33..bcb936c98f 100644 --- a/pkg/service/service.go +++ b/pkg/command/command.go @@ -1,4 +1,4 @@ -package service +package command import ( "os" @@ -11,8 +11,8 @@ import ( "github.com/spf13/viper" ) -// RootCommand is the entry point for the reva-phoenix command. -func RootCommand() *cobra.Command { +// Root is the entry point for the reva-phoenix command. +func Root() *cobra.Command { cmd := &cobra.Command{ Use: "reva-phoenix", Short: "Reva service for phoenix", @@ -39,8 +39,8 @@ func RootCommand() *cobra.Command { viper.SetDefault("log.color", true) viper.BindEnv("log.color", "PHOENIX_LOG_COLOR") - cmd.AddCommand(ServerCommand()) - cmd.AddCommand(HealthCommand()) + cmd.AddCommand(Server()) + cmd.AddCommand(Health()) return cmd } diff --git a/pkg/service/defaults.go b/pkg/command/defaults.go similarity index 90% rename from pkg/service/defaults.go rename to pkg/command/defaults.go index 64586ccdcf..cd80caed27 100644 --- a/pkg/service/defaults.go +++ b/pkg/command/defaults.go @@ -1,4 +1,4 @@ -package service +package command import ( "github.com/spf13/viper" diff --git a/pkg/service/health.go b/pkg/command/health.go similarity index 82% rename from pkg/service/health.go rename to pkg/command/health.go index cbac6d7a60..61a468d853 100644 --- a/pkg/service/health.go +++ b/pkg/command/health.go @@ -1,4 +1,4 @@ -package service +package command import ( "github.com/rs/zerolog/log" @@ -6,8 +6,8 @@ import ( "github.com/spf13/viper" ) -// HealthCommand is the entrypoint for the health command. -func HealthCommand() *cobra.Command { +// Health is the entrypoint for the health command. +func Health() *cobra.Command { cmd := &cobra.Command{ Use: "health", Short: "Check health status", diff --git a/pkg/service/server.go b/pkg/command/server.go similarity index 82% rename from pkg/service/server.go rename to pkg/command/server.go index d3876b4479..4d0f267cee 100644 --- a/pkg/service/server.go +++ b/pkg/command/server.go @@ -1,4 +1,4 @@ -package service +package command import ( "github.com/rs/zerolog/log" @@ -6,8 +6,8 @@ import ( "github.com/spf13/viper" ) -// ServerCommand is the entrypoint for the server command. -func ServerCommand() *cobra.Command { +// Server is the entrypoint for the server command. +func Server() *cobra.Command { cmd := &cobra.Command{ Use: "server", Short: "Start integrated server",