Skip to content

Commit

Permalink
Merge pull request #795 from fastly/fgsch/more_renaming
Browse files Browse the repository at this point in the history
Rename object store 'keys' to 'entry' for consistency
  • Loading branch information
fgsch authored Feb 7, 2023
2 parents d4bba2c + 53a3a8c commit d020d90
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 28 deletions.
22 changes: 11 additions & 11 deletions pkg/app/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (
"github.com/fastly/cli/pkg/commands/logging/syslog"
"github.com/fastly/cli/pkg/commands/logtail"
"github.com/fastly/cli/pkg/commands/objectstore"
"github.com/fastly/cli/pkg/commands/objectstorekeys"
"github.com/fastly/cli/pkg/commands/objectstoreentry"
"github.com/fastly/cli/pkg/commands/pop"
"github.com/fastly/cli/pkg/commands/profile"
"github.com/fastly/cli/pkg/commands/purge"
Expand Down Expand Up @@ -303,11 +303,11 @@ func defineCommands(
objectstoreDelete := objectstore.NewDeleteCommand(objectstoreCmdRoot.CmdClause, globals, data)
objectstoreDescribe := objectstore.NewDescribeCommand(objectstoreCmdRoot.CmdClause, globals, data)
objectstoreList := objectstore.NewListCommand(objectstoreCmdRoot.CmdClause, globals, data)
objectstoreKeysCmdRoot := objectstorekeys.NewRootCommand(app, globals)
objectstoreCreateKey := objectstorekeys.NewCreateCommand(objectstoreKeysCmdRoot.CmdClause, globals, data)
objectstoreDeleteKey := objectstorekeys.NewDeleteCommand(objectstoreKeysCmdRoot.CmdClause, globals, data)
objectstoreGetKey := objectstorekeys.NewGetCommand(objectstoreKeysCmdRoot.CmdClause, globals, data)
objectstoreListKeys := objectstorekeys.NewListCommand(objectstoreKeysCmdRoot.CmdClause, globals, data)
objectstoreentryCmdRoot := objectstoreentry.NewRootCommand(app, globals)
objectstoreentryCreate := objectstoreentry.NewCreateCommand(objectstoreentryCmdRoot.CmdClause, globals, data)
objectstoreentryDelete := objectstoreentry.NewDeleteCommand(objectstoreentryCmdRoot.CmdClause, globals, data)
objectstoreentryDescribe := objectstoreentry.NewDescribeCommand(objectstoreentryCmdRoot.CmdClause, globals, data)
objectstoreentryList := objectstoreentry.NewListCommand(objectstoreentryCmdRoot.CmdClause, globals, data)
popCmdRoot := pop.NewRootCommand(app, globals)
profileCmdRoot := profile.NewRootCommand(app, globals)
profileCreate := profile.NewCreateCommand(profileCmdRoot.CmdClause, profile.APIClientFactory(opts.APIClient), globals)
Expand Down Expand Up @@ -631,13 +631,13 @@ func defineCommands(
loggingSyslogList,
loggingSyslogUpdate,
objectstoreCreate,
objectstoreList,
objectstoreDelete,
objectstoreDescribe,
objectstoreListKeys,
objectstoreCreateKey,
objectstoreGetKey,
objectstoreDeleteKey,
objectstoreList,
objectstoreentryCreate,
objectstoreentryDelete,
objectstoreentryDescribe,
objectstoreentryList,
popCmdRoot,
profileCmdRoot,
profileCreate,
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ ip-list
log-tail
logging
object-store
object-store-keys
object-store-entry
pops
profile
purge
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package objectstorekeys
package objectstoreentry

import (
"io"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package objectstorekeys
package objectstoreentry

import (
"io"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package objectstorekeys
package objectstoreentry

import (
"io"
Expand All @@ -11,23 +11,23 @@ import (
"github.com/fastly/go-fastly/v7/fastly"
)

// GetCommand calls the Fastly API to fetch the value of a key from an object store.
type GetCommand struct {
// DescribeCommand calls the Fastly API to fetch the value of a key from an object store.
type DescribeCommand struct {
cmd.Base
json bool
manifest manifest.Data
Input fastly.GetObjectStoreKeyInput
}

// NewGetCommand returns a usable command registered under the parent.
func NewGetCommand(parent cmd.Registerer, globals *config.Data, data manifest.Data) *GetCommand {
c := GetCommand{
// NewDescribeCommand returns a usable command registered under the parent.
func NewDescribeCommand(parent cmd.Registerer, globals *config.Data, data manifest.Data) *DescribeCommand {
c := DescribeCommand{
Base: cmd.Base{
Globals: globals,
},
manifest: data,
}
c.CmdClause = parent.Command("get", "Get the value associated with a key")
c.CmdClause = parent.Command("describe", "Get the value associated with a key").Alias("get")
c.CmdClause.Flag("store-id", "Store ID").Short('s').Required().StringVar(&c.Input.ID)
c.CmdClause.Flag("key-name", "Key name").Short('k').Required().StringVar(&c.Input.Key)

Expand All @@ -43,7 +43,7 @@ func NewGetCommand(parent cmd.Registerer, globals *config.Data, data manifest.Da
}

// Exec invokes the application logic for the command.
func (c *GetCommand) Exec(_ io.Reader, out io.Writer) error {
func (c *DescribeCommand) Exec(_ io.Reader, out io.Writer) error {
if c.Globals.Verbose() && c.json {
return fsterr.ErrInvalidVerboseJSONCombo
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/commands/objectstoreentry/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Package objectstoreentry contains commands to inspect and manipulate Fastly edge
// object stores keys.
package objectstoreentry
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package objectstorekeys
package objectstoreentry

import (
"encoding/json"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package objectstorekeys
package objectstoreentry

import (
"io"
Expand All @@ -18,7 +18,7 @@ type RootCommand struct {
func NewRootCommand(parent cmd.Registerer, globals *config.Data) *RootCommand {
var c RootCommand
c.Globals = globals
c.CmdClause = parent.Command("object-store-keys", "Manipulate Fastly Object Store keys")
c.CmdClause = parent.Command("object-store-entry", "Manipulate Fastly Object Store keys")
return &c
}

Expand Down
3 changes: 0 additions & 3 deletions pkg/commands/objectstorekeys/doc.go

This file was deleted.

0 comments on commit d020d90

Please sign in to comment.