Skip to content

Commit

Permalink
Remove pkg package. (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamalsaha authored Aug 17, 2017
1 parent 461a297 commit d5a9197
Show file tree
Hide file tree
Showing 36 changed files with 78 additions and 82 deletions.
7 changes: 4 additions & 3 deletions pkg/cmds/config/config.go → cmds/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import "github.com/spf13/cobra"

func NewCmdConfig() *cobra.Command {
cmd := &cobra.Command{
Use: "config",
Short: "OSM configuration",
Example: "osm config view",
Use: "config",
Short: "OSM configuration",
Example: "osm config view",
DisableAutoGenTag: true,
Run: func(cmd *cobra.Command, args []string) {
cmd.Help()
},
Expand Down
9 changes: 5 additions & 4 deletions pkg/cmds/config/current.go → cmds/config/current.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import (
"os"

"github.com/appscode/go-term"
otx "github.com/appscode/osm/pkg/context"
otx "github.com/appscode/osm/context"
"github.com/spf13/cobra"
)

func newCmdCurrent() *cobra.Command {
setCmd := &cobra.Command{
Use: "current-context",
Short: "Print current context",
Example: "osm config current-context",
Use: "current-context",
Short: "Print current context",
Example: "osm config current-context",
DisableAutoGenTag: true,
Run: func(cmd *cobra.Command, args []string) {
if len(args) > 0 {
cmd.Help()
Expand Down
9 changes: 5 additions & 4 deletions pkg/cmds/config/get.go → cmds/config/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ import (
"os"

"github.com/appscode/go-term"
otx "github.com/appscode/osm/pkg/context"
otx "github.com/appscode/osm/context"
"github.com/olekukonko/tablewriter"
"github.com/spf13/cobra"
)

func newCmdGet() *cobra.Command {
setCmd := &cobra.Command{
Use: "get-contexts",
Short: "List available contexts",
Example: "osm config get-contexts",
Use: "get-contexts",
Short: "List available contexts",
Example: "osm config get-contexts",
DisableAutoGenTag: true,
Run: func(cmd *cobra.Command, args []string) {
if len(args) > 0 {
cmd.Help()
Expand Down
9 changes: 5 additions & 4 deletions pkg/cmds/config/set.go → cmds/config/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"

"github.com/appscode/go-term"
otx "github.com/appscode/osm/pkg/context"
otx "github.com/appscode/osm/context"
"github.com/graymeta/stow"
"github.com/graymeta/stow/azure"
gcs "github.com/graymeta/stow/google"
Expand Down Expand Up @@ -47,9 +47,10 @@ type setContextRequest struct {
func newCmdSet() *cobra.Command {
req := &setContextRequest{}
setCmd := &cobra.Command{
Use: "set-context <name>",
Short: "Set context",
Example: "osm config set-context <name>",
Use: "set-context <name>",
Short: "Set context",
Example: "osm config set-context <name>",
DisableAutoGenTag: true,
Run: func(cmd *cobra.Command, args []string) {
if len(args) == 0 {
term.Errorln("Provide context name as argument. See examples:")
Expand Down
9 changes: 5 additions & 4 deletions pkg/cmds/config/use.go → cmds/config/use.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import (
"os"

"github.com/appscode/go-term"
otx "github.com/appscode/osm/pkg/context"
otx "github.com/appscode/osm/context"
"github.com/spf13/cobra"
)

func newCmdUse() *cobra.Command {
setCmd := &cobra.Command{
Use: "use-context <name>",
Short: "Use context",
Example: "osm config use-context <name>",
Use: "use-context <name>",
Short: "Use context",
Example: "osm config use-context <name>",
DisableAutoGenTag: true,
Run: func(cmd *cobra.Command, args []string) {
if len(args) == 0 {
term.Errorln("Provide context name as argument. See examples:")
Expand Down
9 changes: 5 additions & 4 deletions pkg/cmds/config/view.go → cmds/config/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ import (
"os"

"github.com/appscode/go-term"
otx "github.com/appscode/osm/pkg/context"
otx "github.com/appscode/osm/context"
"github.com/ghodss/yaml"
"github.com/spf13/cobra"
)

func newCmdView() *cobra.Command {
setCmd := &cobra.Command{
Use: "view",
Short: "Print osm config",
Example: "osm config view",
Use: "view",
Short: "Print osm config",
Example: "osm config view",
DisableAutoGenTag: true,
Run: func(cmd *cobra.Command, args []string) {
if len(args) > 0 {
cmd.Help()
Expand Down
9 changes: 5 additions & 4 deletions pkg/cmds/lc.go → cmds/lc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"

"github.com/appscode/go-term"
otx "github.com/appscode/osm/pkg/context"
otx "github.com/appscode/osm/context"
"github.com/graymeta/stow"
"github.com/spf13/cobra"
)
Expand All @@ -17,9 +17,10 @@ type containerListRequest struct {
func NewCmdListContainers() *cobra.Command {
req := &containerListRequest{}
cmd := &cobra.Command{
Use: "lc",
Short: "List containers",
Example: "osm lc",
Use: "lc",
Short: "List containers",
Example: "osm lc",
DisableAutoGenTag: true,
Run: func(cmd *cobra.Command, args []string) {
if len(args) > 1 {
cmd.Help()
Expand Down
9 changes: 5 additions & 4 deletions pkg/cmds/ls.go → cmds/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"

"github.com/appscode/go-term"
otx "github.com/appscode/osm/pkg/context"
otx "github.com/appscode/osm/context"
"github.com/graymeta/stow"
"github.com/spf13/cobra"
)
Expand All @@ -20,9 +20,10 @@ type itemListRequest struct {
func NewCmdListIetms() *cobra.Command {
req := &itemListRequest{}
cmd := &cobra.Command{
Use: "ls <name>",
Short: "List container",
Example: "osm ls mybucket",
Use: "ls <name>",
Short: "List container",
Example: "osm ls mybucket",
DisableAutoGenTag: true,
Run: func(cmd *cobra.Command, args []string) {
if len(args) == 0 {
term.Errorln("Provide container name as argument. See examples:")
Expand Down
9 changes: 5 additions & 4 deletions pkg/cmds/mc.go → cmds/mc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os"

"github.com/appscode/go-term"
otx "github.com/appscode/osm/pkg/context"
otx "github.com/appscode/osm/context"
"github.com/spf13/cobra"
)

Expand All @@ -16,9 +16,10 @@ type containerMakeRequest struct {
func NewCmdMakeContainer() *cobra.Command {
req := &containerMakeRequest{}
cmd := &cobra.Command{
Use: "mc <name>",
Short: "Make container",
Example: "osm mc mybucket",
Use: "mc <name>",
Short: "Make container",
Example: "osm mc mybucket",
DisableAutoGenTag: true,
Run: func(cmd *cobra.Command, args []string) {
if len(args) == 0 {
term.Errorln("Provide container name as argument. See examples:")
Expand Down
9 changes: 5 additions & 4 deletions pkg/cmds/pull.go → cmds/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/appscode/go-term"
"github.com/appscode/go/io"
otx "github.com/appscode/osm/pkg/context"
otx "github.com/appscode/osm/context"
"github.com/graymeta/stow"
"github.com/spf13/cobra"
)
Expand All @@ -21,9 +21,10 @@ type itemPullRequest struct {
func NewCmdPull() *cobra.Command {
req := &itemPullRequest{}
cmd := &cobra.Command{
Use: "pull <src> <dest>",
Short: "Pull item from container",
Example: "osm pull -c mybucket f1.txt /tmp/f1.txt",
Use: "pull <src> <dest>",
Short: "Pull item from container",
Example: "osm pull -c mybucket f1.txt /tmp/f1.txt",
DisableAutoGenTag: true,
Run: func(cmd *cobra.Command, args []string) {
if len(args) < 2 {
term.Errorln("Provide source item and destination path as argument. See examples:")
Expand Down
9 changes: 5 additions & 4 deletions pkg/cmds/push.go → cmds/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"path/filepath"

"github.com/appscode/go-term"
otx "github.com/appscode/osm/pkg/context"
otx "github.com/appscode/osm/context"
"github.com/graymeta/stow"
"github.com/spf13/cobra"
)
Expand All @@ -20,9 +20,10 @@ type itemPushRequest struct {
func NewCmdPush() *cobra.Command {
req := &itemPushRequest{}
cmd := &cobra.Command{
Use: "push <src> <dest>",
Short: "Push item from container",
Example: "osm push -c mybucket f1.txt /tmp/f1.txt",
Use: "push <src> <dest>",
Short: "Push item from container",
Example: "osm push -c mybucket f1.txt /tmp/f1.txt",
DisableAutoGenTag: true,
Run: func(cmd *cobra.Command, args []string) {
if len(args) < 2 {
term.Errorln("Provide source path and destination item as argument. See examples:")
Expand Down
9 changes: 5 additions & 4 deletions pkg/cmds/rc.go → cmds/rc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os"

"github.com/appscode/go-term"
otx "github.com/appscode/osm/pkg/context"
otx "github.com/appscode/osm/context"
"github.com/graymeta/stow"
"github.com/spf13/cobra"
)
Expand All @@ -18,9 +18,10 @@ type containerRemoveRequest struct {
func NewCmdRemoveContainer() *cobra.Command {
req := &containerRemoveRequest{}
cmd := &cobra.Command{
Use: "rc <name>",
Short: "Remove container",
Example: "osm rc mybucket",
Use: "rc <name>",
Short: "Remove container",
Example: "osm rc mybucket",
DisableAutoGenTag: true,
Run: func(cmd *cobra.Command, args []string) {
if len(args) == 0 {
term.Errorln("Provide container name as argument. See examples:")
Expand Down
9 changes: 5 additions & 4 deletions pkg/cmds/rm.go → cmds/rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os"

"github.com/appscode/go-term"
otx "github.com/appscode/osm/pkg/context"
otx "github.com/appscode/osm/context"
"github.com/spf13/cobra"
)

Expand All @@ -17,9 +17,10 @@ type itemRemoveRequest struct {
func NewCmdRemove() *cobra.Command {
req := &itemRemoveRequest{}
cmd := &cobra.Command{
Use: "rm <id>",
Short: "Remove item from container",
Example: "osm rm -c mybucket f1.txt",
Use: "rm <id>",
Short: "Remove item from container",
Example: "osm rm -c mybucket f1.txt",
DisableAutoGenTag: true,
Run: func(cmd *cobra.Command, args []string) {
if len(args) == 0 {
term.Errorln("Provide item id as argument. See examples:")
Expand Down
7 changes: 4 additions & 3 deletions pkg/cmds/root.go → cmds/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import (
"flag"

v "github.com/appscode/go/version"
cfgCmd "github.com/appscode/osm/pkg/cmds/config"
cfgCmd "github.com/appscode/osm/cmds/config"
"github.com/mitchellh/go-homedir"
"github.com/spf13/cobra"
)

func NewCmdOsm() *cobra.Command {
rootCmd := &cobra.Command{
Use: "osm [command]",
Short: `Object Store Manipulator by AppsCode`,
Use: "osm [command]",
Short: `Object Store Manipulator by AppsCode`,
DisableAutoGenTag: true,
Run: func(c *cobra.Command, args []string) {
c.Help()
},
Expand Down
9 changes: 5 additions & 4 deletions pkg/cmds/stat.go → cmds/stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"

"github.com/appscode/go-term"
otx "github.com/appscode/osm/pkg/context"
otx "github.com/appscode/osm/context"
"github.com/dustin/go-humanize"
"github.com/spf13/cobra"
)
Expand All @@ -19,9 +19,10 @@ type itemStatRequest struct {
func NewCmdStat() *cobra.Command {
req := &itemStatRequest{}
cmd := &cobra.Command{
Use: "stat <id>",
Short: "Stat item from container",
Example: "osm stat -c mybucket f1.txt",
Use: "stat <id>",
Short: "Stat item from container",
Example: "osm stat -c mybucket f1.txt",
DisableAutoGenTag: true,
Run: func(cmd *cobra.Command, args []string) {
if len(args) == 0 {
term.Errorln("Provide item id as argument. See examples:")
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion docs/reference/osm.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,3 @@ osm [command] [flags]
* [osm stat](osm_stat.md) - Stat item from container
* [osm version](osm_version.md) - Prints binary version number.


1 change: 0 additions & 1 deletion docs/reference/osm_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,3 @@ osm config view
* [osm config use-context](osm_config_use-context.md) - Use context
* [osm config view](osm_config_view.md) - Print osm config


1 change: 0 additions & 1 deletion docs/reference/osm_config_current-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ osm config current-context
### SEE ALSO
* [osm config](osm_config.md) - OSM configuration


1 change: 0 additions & 1 deletion docs/reference/osm_config_get-contexts.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ osm config get-contexts
### SEE ALSO
* [osm config](osm_config.md) - OSM configuration


1 change: 0 additions & 1 deletion docs/reference/osm_config_set-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,3 @@ osm config set-context <name>
### SEE ALSO
* [osm config](osm_config.md) - OSM configuration


1 change: 0 additions & 1 deletion docs/reference/osm_config_use-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ osm config use-context <name>
### SEE ALSO
* [osm config](osm_config.md) - OSM configuration


1 change: 0 additions & 1 deletion docs/reference/osm_config_view.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ osm config view
### SEE ALSO
* [osm config](osm_config.md) - OSM configuration


1 change: 0 additions & 1 deletion docs/reference/osm_lc.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,3 @@ osm lc
### SEE ALSO
* [osm](osm.md) - Object Store Manipulator by AppsCode


1 change: 0 additions & 1 deletion docs/reference/osm_ls.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,3 @@ osm ls mybucket
### SEE ALSO
* [osm](osm.md) - Object Store Manipulator by AppsCode


1 change: 0 additions & 1 deletion docs/reference/osm_mc.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,3 @@ osm mc mybucket
### SEE ALSO
* [osm](osm.md) - Object Store Manipulator by AppsCode


1 change: 0 additions & 1 deletion docs/reference/osm_pull.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,3 @@ osm pull -c mybucket f1.txt /tmp/f1.txt
### SEE ALSO
* [osm](osm.md) - Object Store Manipulator by AppsCode


1 change: 0 additions & 1 deletion docs/reference/osm_push.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,3 @@ osm push -c mybucket f1.txt /tmp/f1.txt
### SEE ALSO
* [osm](osm.md) - Object Store Manipulator by AppsCode


1 change: 0 additions & 1 deletion docs/reference/osm_rc.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,3 @@ osm rc mybucket
### SEE ALSO
* [osm](osm.md) - Object Store Manipulator by AppsCode


1 change: 0 additions & 1 deletion docs/reference/osm_rm.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,3 @@ osm rm -c mybucket f1.txt
### SEE ALSO
* [osm](osm.md) - Object Store Manipulator by AppsCode


Loading

0 comments on commit d5a9197

Please sign in to comment.