cmd

package
v0.1.57 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Functions

func StartCli

func StartCli()

Types

type Command

type Command interface {
	Description() CommandDesc
	Execute(ctx context.Context) error
	ParseFlags(set *flag.FlagSet, strings []string)
}

type CommandDesc

type CommandDesc struct {
	Name        string
	Description string
	Usage       string
}

type DeleteCommand

type DeleteCommand struct {
	ApiKey         string
	ServerEndpoint string
	ResourceId     string
}

DeleteCommand - Deletes a resource by id.

func (*DeleteCommand) Description

func (c *DeleteCommand) Description() CommandDesc

func (*DeleteCommand) Execute

func (c *DeleteCommand) Execute(ctx context.Context) error

func (*DeleteCommand) ParseFlags

func (c *DeleteCommand) ParseFlags(f *flag.FlagSet, args []string)

type HelpCommand

type HelpCommand struct {
	AvailableCommands []Command
}

func (*HelpCommand) Description

func (c *HelpCommand) Description() CommandDesc

func (*HelpCommand) Execute

func (c *HelpCommand) Execute(ctx context.Context) error

func (*HelpCommand) ParseFlags

func (c *HelpCommand) ParseFlags(f *flag.FlagSet, args []string)

type ListCommand

type ListCommand struct {
	ApiKey         string
	ServerEndpoint string
}

ListCommand - Lists all resource ids.

func (*ListCommand) Description

func (c *ListCommand) Description() CommandDesc

func (*ListCommand) Execute

func (c *ListCommand) Execute(ctx context.Context) error

func (*ListCommand) ParseFlags

func (c *ListCommand) ParseFlags(f *flag.FlagSet, args []string)

type ServeCommand

type ServeCommand struct {
	Port int
	Env  string
}

ServeCommand - Temporary command to start the grpc server. Eventually we won't have a CLI / it will live in a diff repo.

func (*ServeCommand) Description

func (c *ServeCommand) Description() CommandDesc

func (*ServeCommand) Execute

func (c *ServeCommand) Execute(ctx context.Context) error

func (*ServeCommand) ParseFlags

func (c *ServeCommand) ParseFlags(f *flag.FlagSet, args []string)

type VersionCommand

type VersionCommand struct {
}

func (*VersionCommand) Description

func (c *VersionCommand) Description() CommandDesc

func (*VersionCommand) Execute

func (c *VersionCommand) Execute(ctx context.Context) error

func (*VersionCommand) ParseFlags

func (c *VersionCommand) ParseFlags(f *flag.FlagSet, args []string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL