Skip to content

Commit

Permalink
better naming
Browse files Browse the repository at this point in the history
  • Loading branch information
ingon committed Jan 28, 2024
1 parent 08b233a commit 47e6113
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions egress_webhooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/klev-dev/klev-api-go/logs"
)

func egressWebhooksCommand() *cobra.Command {
func egressWebhooksRoot() *cobra.Command {
cmd := &cobra.Command{
Use: "egress-webhooks",
Short: "interact with egress webhooks",
Expand Down Expand Up @@ -50,7 +50,7 @@ func egressWebhooksCreate() *cobra.Command {
Short: "create new egress webhook",
}

var in egress_webhooks.EgressWebhookCreate
var in egress_webhooks.CreateParams

logID := cmd.Flags().String("log-id", "", "log id that will store webhook data")
cmd.Flags().StringVar(&in.Metadata, "metadata", "", "machine readable metadata")
Expand Down Expand Up @@ -89,7 +89,7 @@ func egressWebhooksRotate() *cobra.Command {
Args: cobra.ExactArgs(1),
}

var in egress_webhooks.EgressWebhookRotate
var in egress_webhooks.RotateParams

cmd.Flags().Int64Var(&in.ExpireSeconds, "expire-seconds", 0, "for how long the old secret is valid")

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/klev-dev/klev-cli
go 1.19

require (
github.com/klev-dev/klev-api-go v0.4.0
github.com/klev-dev/klev-api-go v0.4.1
github.com/spf13/cobra v1.6.1
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=
github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/klev-dev/klev-api-go v0.4.0 h1:M+GOU/rjtB37NZ1DHToyuPB6wqQfjTWmbqfWqtcY8V4=
github.com/klev-dev/klev-api-go v0.4.0/go.mod h1:RNe/KNgqBRjY/VYp87CwCS4wIsQMTNmdIvICEAeETR8=
github.com/klev-dev/klev-api-go v0.4.1 h1:yvE09kZD6rBKwtaZPlbO1dOstrPhJo+b6JLBY7RoA+U=
github.com/klev-dev/klev-api-go v0.4.1/go.mod h1:RNe/KNgqBRjY/VYp87CwCS4wIsQMTNmdIvICEAeETR8=
github.com/klev-dev/kleverr v0.0.0-20230327002055-63b8717d8103 h1:QTdI0Ut6fvND4SCeuJqsuAY9FajkkmNL+okMFO9UuaU=
github.com/klev-dev/kleverr v0.0.0-20230327002055-63b8717d8103/go.mod h1:DV1tEcfsgAzKraeb/7nux27wOJs8w9P8fLB6GT7DmGM=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down
6 changes: 3 additions & 3 deletions ingress_webhooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/klev-dev/klev-api-go/logs"
)

func ingressWebhooksCommand() *cobra.Command {
func ingressWebhooksRoot() *cobra.Command {
cmd := &cobra.Command{
Use: "ingress-webhooks",
Short: "interact with ingress webhooks",
Expand Down Expand Up @@ -49,7 +49,7 @@ func ingressWebhooksCreate() *cobra.Command {
Short: "create new ingress webhook",
}

var in ingress_webhooks.IngressWebhookCreate
var in ingress_webhooks.CreateParams

logID := cmd.Flags().String("log-id", "", "log id that will store webhook data")
cmd.Flags().StringVar(&in.Metadata, "metadata", "", "machine readable metadata")
Expand Down Expand Up @@ -88,7 +88,7 @@ func ingressWebhooksRotate() *cobra.Command {
Short: "rotate ingress webhook secret",
}

var in ingress_webhooks.IngressWebhookRotate
var in ingress_webhooks.RotateParams

cmd.Flags().StringVar(&in.Secret, "secret", "", "the secret to validate webhook messages")

Expand Down
4 changes: 2 additions & 2 deletions logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"github.com/spf13/cobra"
)

func logsCommand() *cobra.Command {
func logsRoot() *cobra.Command {
cmd := &cobra.Command{
Use: "logs",
Short: "interact with logs",
Expand Down Expand Up @@ -46,7 +46,7 @@ func logsCreate() *cobra.Command {
Short: "create new log",
}

var in logs.LogCreate
var in logs.CreateParams

cmd.Flags().StringVar(&in.Metadata, "metadata", "", "machine readable metadata")
cmd.Flags().BoolVar(&in.Compacting, "compacting", false, "if the log is compacting")
Expand Down
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ func main() {
rootCmd.AddCommand(publish())
rootCmd.AddCommand(consume())
rootCmd.AddCommand(receive())
rootCmd.AddCommand(logsCommand())
rootCmd.AddCommand(offsetsCommand())
rootCmd.AddCommand(tokensCommand())
rootCmd.AddCommand(ingressWebhooksCommand())
rootCmd.AddCommand(egressWebhooksCommand())
rootCmd.AddCommand(logsRoot())
rootCmd.AddCommand(offsetsRoot())
rootCmd.AddCommand(tokensRoot())
rootCmd.AddCommand(ingressWebhooksRoot())
rootCmd.AddCommand(egressWebhooksRoot())

if err := rootCmd.Execute(); err != nil {
fmt.Fprintln(os.Stderr, err)
Expand Down
6 changes: 3 additions & 3 deletions offsets.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/spf13/cobra"
)

func offsetsCommand() *cobra.Command {
func offsetsRoot() *cobra.Command {
cmd := &cobra.Command{
Use: "offsets",
Short: "interact with offsets",
Expand Down Expand Up @@ -48,7 +48,7 @@ func offsetsCreate() *cobra.Command {
Short: "create new offset",
}

var in offsets.OffsetCreate
var in offsets.CreateParams

logID := cmd.Flags().String("log-id", "", "log id for this offset")
cmd.Flags().StringVar(&in.Metadata, "metadata", "", "machine readable metadata")
Expand Down Expand Up @@ -83,7 +83,7 @@ func offsetsSet() *cobra.Command {
Args: cobra.ExactArgs(1),
}

var in offsets.OffsetSet
var in offsets.SetParams
cmd.Flags().Int64Var(&in.Value, "value", 0, "value to set")
cmd.Flags().StringVar(&in.ValueMetadata, "value-metadata", "", "machine readable metadata for the value")

Expand Down
4 changes: 2 additions & 2 deletions tokens.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"github.com/spf13/cobra"
)

func tokensCommand() *cobra.Command {
func tokensRoot() *cobra.Command {
cmd := &cobra.Command{
Use: "tokens",
Short: "interact with tokens",
Expand Down Expand Up @@ -46,7 +46,7 @@ func tokensCreate() *cobra.Command {
Short: "create new token",
}

var in tokens.TokenCreate
var in tokens.CreateParams

cmd.Flags().StringVar(&in.Metadata, "metadata", "", "machine readable metadata")
cmd.Flags().StringArrayVar(&in.ACL, "acl", nil, "token acl")
Expand Down

0 comments on commit 47e6113

Please sign in to comment.