cli

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package cli implements the commands for the AOD(Access On Demand) CLI.

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = func() cli.Command {
	return &cli.RootCommand{
		Name:    "aod",
		Version: version.HumanVersion,
		Commands: map[string]cli.CommandFactory{
			"iam": func() cli.Command {
				return &cli.RootCommand{
					Name:        "iam",
					Description: "Perform operations to modify IAM policies on demand",
					Commands: map[string]cli.CommandFactory{
						"handle": func() cli.Command {
							return &IAMHandleCommand{}
						},
						"cleanup": func() cli.Command {
							return &IAMCleanupCommand{}
						},
						"validate": func() cli.Command {
							return &IAMValidateCommand{}
						},
					},
				}
			},
			"tool": func() cli.Command {
				return &cli.RootCommand{
					Name:        "tool",
					Description: "Perform operations to run CLI tools on demand",
					Commands: map[string]cli.CommandFactory{
						"do": func() cli.Command {
							return &ToolDoCommand{}
						},
						"validate": func() cli.Command {
							return &ToolValidateCommand{}
						},
					},
				}
			},
		},
	}
}

RootCmd defines the starting command structure.

Functions

func Run

func Run(ctx context.Context, args []string) error

Run executes the CLI.

Types

type IAMCleanupCommand

type IAMCleanupCommand struct {
	cli.BaseCommand
	// contains filtered or unexported fields
}

IAMCleanupCommand handles the cleanup of IAM requests, which removed the requested bindings and expires AOD bindings from IAM policy.

func (*IAMCleanupCommand) Desc

func (c *IAMCleanupCommand) Desc() string

func (*IAMCleanupCommand) Flags

func (c *IAMCleanupCommand) Flags() *cli.FlagSet

func (*IAMCleanupCommand) Help

func (c *IAMCleanupCommand) Help() string

func (*IAMCleanupCommand) Run

func (c *IAMCleanupCommand) Run(ctx context.Context, args []string) error

type IAMHandleCommand

type IAMHandleCommand struct {
	cli.BaseCommand
	// contains filtered or unexported fields
}

IAMHandleCommand handles IAM requests.

func (*IAMHandleCommand) Desc

func (c *IAMHandleCommand) Desc() string

func (*IAMHandleCommand) Flags

func (c *IAMHandleCommand) Flags() *cli.FlagSet

func (*IAMHandleCommand) Help

func (c *IAMHandleCommand) Help() string

func (*IAMHandleCommand) Run

func (c *IAMHandleCommand) Run(ctx context.Context, args []string) error

type IAMValidateCommand

type IAMValidateCommand struct {
	cli.BaseCommand
	// contains filtered or unexported fields
}

IAMValidateCommand validates IAM requests.

func (*IAMValidateCommand) Desc

func (c *IAMValidateCommand) Desc() string

func (*IAMValidateCommand) Flags

func (c *IAMValidateCommand) Flags() *cli.FlagSet

func (*IAMValidateCommand) Help

func (c *IAMValidateCommand) Help() string

func (*IAMValidateCommand) Run

func (c *IAMValidateCommand) Run(ctx context.Context, args []string) error

type ToolDoCommand

type ToolDoCommand struct {
	cli.BaseCommand
	// contains filtered or unexported fields
}

ToolDoCommand handles tool requests "do" commands.

func (*ToolDoCommand) Desc

func (c *ToolDoCommand) Desc() string

func (*ToolDoCommand) Flags added in v0.1.4

func (c *ToolDoCommand) Flags() *cli.FlagSet

func (*ToolDoCommand) Help added in v0.1.4

func (c *ToolDoCommand) Help() string

func (*ToolDoCommand) Run

func (c *ToolDoCommand) Run(ctx context.Context, args []string) error

type ToolValidateCommand

type ToolValidateCommand struct {
	cli.BaseCommand
	// contains filtered or unexported fields
}

ToolValidateCommand validates tool requests.

func (*ToolValidateCommand) Desc

func (c *ToolValidateCommand) Desc() string

func (*ToolValidateCommand) Flags

func (c *ToolValidateCommand) Flags() *cli.FlagSet

func (*ToolValidateCommand) Help

func (c *ToolValidateCommand) Help() string

func (*ToolValidateCommand) Run

func (c *ToolValidateCommand) Run(ctx context.Context, args []string) error

Jump to

Keyboard shortcuts

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