Skip to content

Commit

Permalink
Consistency: use singular for Action even though it's weird
Browse files Browse the repository at this point in the history
  • Loading branch information
cyx committed Jan 26, 2021
1 parent b19e08c commit d0bf6f5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion internal/auth0/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package auth0

import "gopkg.in/auth0.v5/management"

type ActionsAPI interface {
type ActionAPI interface {
Create(a *management.Action) error
Read(id string) (*management.Action, error)
Update(id string, a *management.Action) error
Expand Down
2 changes: 1 addition & 1 deletion internal/auth0/auth0.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "gopkg.in/auth0.v5"
// API mimics `management.Management`s general interface, except it uses
// methods since we can't really mock fields.
type API interface {
Actions() ActionsAPI
Action() ActionAPI
Client() ClientAPI
Connection() ConnectionAPI
Log() LogAPI
Expand Down
6 changes: 3 additions & 3 deletions internal/auth0/auth0test/auth0test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ var _ auth0.API = &API{}
// all the known accessors, so testers can specify the only subsection they
// care about.
type API struct {
ActionsAPI auth0.ActionsAPI
ActionAPI auth0.ActionAPI
ClientAPI auth0.ClientAPI
ConnectionAPI auth0.ConnectionAPI
LogAPI auth0.LogAPI
ResourceServerAPI auth0.ResourceServerAPI
RuleAPI auth0.RuleAPI
}

func (a *API) Actions() auth0.ActionsAPI {
return a.ActionsAPI
func (a *API) Action() auth0.ActionAPI {
return a.ActionAPI
}

func (a *API) Client() auth0.ClientAPI {
Expand Down
2 changes: 1 addition & 1 deletion internal/auth0/shim.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type shim struct {
m *management.Management
}

func (s *shim) Actions() ActionsAPI {
func (s *shim) Action() ActionAPI {
return s.m.Action
}

Expand Down
4 changes: 2 additions & 2 deletions internal/cli/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Lists your existing actions. To create one try:
$ auth0 actions create
`,
RunE: func(cmd *cobra.Command, args []string) error {
list, err := cli.api.Actions().List()
list, err := cli.api.Action().List()
if err != nil {
return err
}
Expand Down Expand Up @@ -83,7 +83,7 @@ Creates a new action:
}

err = ansi.Spinner("Creating action", func() error {
return cli.api.Actions().Create(action)
return cli.api.Action().Create(action)
})

if err != nil {
Expand Down

0 comments on commit d0bf6f5

Please sign in to comment.