commands

package
v0.0.0-...-865a493 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSortedKeyList

func GetSortedKeyList(cmdMap map[string]Command) []string

Types

type Command

type Command interface {
	GetFlags() *flag.FlagSet
	Apply(*CommandLineContext) runner.Runner
	Description() string
}

Command represents a CLI command

type CommandLineContext

type CommandLineContext struct {
	Db     storage.Provider
	Log    *logr.Logger
	Caller client.APICaller

	Api *api.API
	// contains filtered or unexported fields
}

CommandLineContext processing with API calls

func CreateContext

func CreateContext(db storage.Provider, log *logr.Logger,
	apiClient client.APICaller, res embed.FS, apiServer *api.API) *CommandLineContext

CreateContext an instance of the CLI object

type LoginOptions

type LoginOptions struct {
	// contains filtered or unexported fields
}

ServerOptions according to arguments

func LoginFlags

func LoginFlags() *LoginOptions

ServerFlags obtains flags for apply action

func (*LoginOptions) Apply

Apply the command.

func (*LoginOptions) Description

func (o *LoginOptions) Description() string

Description for the current command.

func (*LoginOptions) GetFlags

func (o *LoginOptions) GetFlags() *flag.FlagSet

GetFlags for the current command.

type MonitorAddAction

type MonitorAddAction struct {
	// contains filtered or unexported fields
}

MonitorAddAction represents the list action of targets.

func MonitorAddActionFlags

func MonitorAddActionFlags(parentFs *flag.FlagSet) *MonitorAddAction

MonitorAddActionFlags obtains flags for target list action

func (*MonitorAddAction) Apply

Apply the current action.

func (*MonitorAddAction) Description

func (o *MonitorAddAction) Description() string

Description for the current command.

func (*MonitorAddAction) GetFlags

func (o *MonitorAddAction) GetFlags() *flag.FlagSet

GetFlags for the current command.

type MonitorOptions

type MonitorOptions struct {
	// contains filtered or unexported fields
}

MonitorOptions according to arguments

func (*MonitorOptions) Apply

Apply the command.

func (*MonitorOptions) Description

func (o *MonitorOptions) Description() string

Description for the current command.

func (*MonitorOptions) GetFlags

func (o *MonitorOptions) GetFlags() *flag.FlagSet

GetFlags for the current command.

type RoleAddAction

type RoleAddAction struct {
	// contains filtered or unexported fields
}

RoleAddAction represents the list action of targets.

func RoleAddActionFlags

func RoleAddActionFlags(parentFs *flag.FlagSet) *RoleAddAction

RoleAddActionFlags obtains flags for target list action

func (*RoleAddAction) Apply

Apply the current action.

func (*RoleAddAction) Description

func (o *RoleAddAction) Description() string

Description for the current command.

func (*RoleAddAction) GetFlags

func (o *RoleAddAction) GetFlags() *flag.FlagSet

GetFlags for the current command.

type RoleAssignAction

type RoleAssignAction struct {
	// contains filtered or unexported fields
}

RoleAssignAction represents the list action of targets.

func RoleAssignActionFlags

func RoleAssignActionFlags(parentFs *flag.FlagSet) *RoleAssignAction

RoleAssignActionFlags obtains flags for target list action

func (*RoleAssignAction) Apply

Apply the current action.

func (*RoleAssignAction) Description

func (o *RoleAssignAction) Description() string

Description for the current command.

func (*RoleAssignAction) GetFlags

func (o *RoleAssignAction) GetFlags() *flag.FlagSet

GetFlags for the current command.

type RoleListAction

type RoleListAction struct {
	// contains filtered or unexported fields
}

RoleListAction represents the list action of targets.

func RoleListActionFlags

func RoleListActionFlags(parentFs *flag.FlagSet) *RoleListAction

RoleListActionFlags obtains flags for target list action

func (*RoleListAction) Apply

Apply the current action.

func (*RoleListAction) Description

func (o *RoleListAction) Description() string

Description for the current command.

func (*RoleListAction) GetFlags

func (o *RoleListAction) GetFlags() *flag.FlagSet

GetFlags for the current command.

type RoleOptions

type RoleOptions struct {
	// contains filtered or unexported fields
}

RoleOptions according to arguments

func RoleFlags

func RoleFlags() *RoleOptions

RoleFlags obtains flags for apply action

func (*RoleOptions) Apply

Apply the command.

func (*RoleOptions) Description

func (o *RoleOptions) Description() string

Description for the current command.

func (*RoleOptions) GetFlags

func (o *RoleOptions) GetFlags() *flag.FlagSet

GetFlags for the current command.

type RoleRevokeAction

type RoleRevokeAction struct {
	// contains filtered or unexported fields
}

RoleRevokeAction represents the revoke action of roles.

func RoleRevokeActionFlags

func RoleRevokeActionFlags(parentFs *flag.FlagSet) *RoleRevokeAction

RoleRevokeActionFlags obtains flags for target list action

func (*RoleRevokeAction) Apply

Apply the current action.

func (*RoleRevokeAction) Description

func (o *RoleRevokeAction) Description() string

Description for the current command.

func (*RoleRevokeAction) GetFlags

func (o *RoleRevokeAction) GetFlags() *flag.FlagSet

GetFlags for the current command.

type ServerOptions

type ServerOptions struct {
	Address string
	// contains filtered or unexported fields
}

ServerOptions according to arguments

func ServerFlags

func ServerFlags() *ServerOptions

ServerFlags obtains flags for apply action

func (*ServerOptions) Apply

Apply the command.

func (*ServerOptions) Description

func (o *ServerOptions) Description() string

Description for the current command.

func (*ServerOptions) GetFlags

func (o *ServerOptions) GetFlags() *flag.FlagSet

GetFlags for the current command.

type TargetAddAction

type TargetAddAction struct {
	// contains filtered or unexported fields
}

TargetAddAction represents the list action of targets.

func TargetAddActionFlags

func TargetAddActionFlags(parentFs *flag.FlagSet) *TargetAddAction

TargetAddActionFlags obtains flags for target list action

func (*TargetAddAction) Apply

Apply the current action.

func (*TargetAddAction) Description

func (o *TargetAddAction) Description() string

Description for the current command.

func (*TargetAddAction) GetFlags

func (o *TargetAddAction) GetFlags() *flag.FlagSet

GetFlags for the current command.

type TargetGetAction

type TargetGetAction struct {
	// contains filtered or unexported fields
}

TargetGetAction represents the get action for target a given target and its direct descendants.

func TargetGetActionFlags

func TargetGetActionFlags(parentFs *flag.FlagSet) *TargetGetAction

TargetGetActionFlags obtains flags for target get action

func (*TargetGetAction) Apply

Apply the current action.

func (*TargetGetAction) Description

func (o *TargetGetAction) Description() string

Description for the current command.

func (*TargetGetAction) GetFlags

func (o *TargetGetAction) GetFlags() *flag.FlagSet

GetFlags for the current command.

type TargetListAction

type TargetListAction struct {
	// contains filtered or unexported fields
}

TargetListAction represents the list action of targets.

func TargetListActionFlags

func TargetListActionFlags(parentFs *flag.FlagSet) *TargetListAction

TargetListActionFlags obtains flags for target list action

func (*TargetListAction) Apply

Apply the current action.

func (*TargetListAction) Description

func (o *TargetListAction) Description() string

Description for the current command.

func (*TargetListAction) GetFlags

func (o *TargetListAction) GetFlags() *flag.FlagSet

GetFlags for the current command.

type TargetOptions

type TargetOptions struct {
	// contains filtered or unexported fields
}

TargetOptions according to arguments

func MonitorFlags

func MonitorFlags() *TargetOptions

MonitorFlags obtains flags for apply action

func TargetFlags

func TargetFlags() *TargetOptions

TargetFlags obtains flags for apply action

func (*TargetOptions) Apply

Apply the command.

func (*TargetOptions) Description

func (o *TargetOptions) Description() string

Description for the current command.

func (*TargetOptions) GetFlags

func (o *TargetOptions) GetFlags() *flag.FlagSet

GetFlags for the current command.

type TargetRemoveAction

type TargetRemoveAction struct {
	// contains filtered or unexported fields
}

TargetRemoveAction represents the remove action for a target and descendants.

func TargetRemoveActionFlags

func TargetRemoveActionFlags(parentFs *flag.FlagSet) *TargetRemoveAction

TargetRemoveActionFlags obtains flags for target remove action

func (*TargetRemoveAction) Apply

Apply the current action.

func (*TargetRemoveAction) Description

func (o *TargetRemoveAction) Description() string

Description for the current command.

func (*TargetRemoveAction) GetFlags

func (o *TargetRemoveAction) GetFlags() *flag.FlagSet

GetFlags for the current command.

type TargetUpdateStatusAction

type TargetUpdateStatusAction struct {
	// contains filtered or unexported fields
}

TargetUpdateStatusAction represents the list action of targets.

func TargetUpdateStatusActionFlags

func TargetUpdateStatusActionFlags(parentFs *flag.FlagSet) *TargetUpdateStatusAction

TargetUpdateStatusActionFlags obtains flags for target list action

func (*TargetUpdateStatusAction) Apply

Apply the current action.

func (*TargetUpdateStatusAction) Description

func (o *TargetUpdateStatusAction) Description() string

Description for the current command.

func (*TargetUpdateStatusAction) GetFlags

func (o *TargetUpdateStatusAction) GetFlags() *flag.FlagSet

GetFlags for the current command.

type UIOptions

type UIOptions struct {
	Address string
	// contains filtered or unexported fields
}

UIOptions according to arguments

func UIOptionsFlags

func UIOptionsFlags() *UIOptions

UIOptionsFlags obtains flags for apply action

func (*UIOptions) Apply

Apply the command.

func (*UIOptions) Description

func (o *UIOptions) Description() string

Description for the current command.

func (*UIOptions) GetFlags

func (o *UIOptions) GetFlags() *flag.FlagSet

GetFlags for the current command.

type UserListAction

type UserListAction struct {
	// contains filtered or unexported fields
}

UserListAction represents the list action of targets.

func UserListActionFlags

func UserListActionFlags(parentFs *flag.FlagSet) *UserListAction

UserListActionFlags obtains flags for target list action

func (*UserListAction) Apply

Apply the current action.

func (*UserListAction) Description

func (o *UserListAction) Description() string

Description for the current command.

func (*UserListAction) GetFlags

func (o *UserListAction) GetFlags() *flag.FlagSet

GetFlags for the current command.

type UserOptions

type UserOptions struct {
	// contains filtered or unexported fields
}

UserOptions according to arguments

func UserFlags

func UserFlags() *UserOptions

UserFlags obtains flags for apply action

func (*UserOptions) Apply

Apply the command.

func (*UserOptions) Description

func (o *UserOptions) Description() string

Description for the current command.

func (*UserOptions) GetFlags

func (o *UserOptions) GetFlags() *flag.FlagSet

GetFlags for the current command.

type UserTokenAction

type UserTokenAction struct {
	// contains filtered or unexported fields
}

UserTokenAction represents the list action of targets.

func UserTokenActionFlags

func UserTokenActionFlags(parentFs *flag.FlagSet) *UserTokenAction

UserTokenActionFlags obtains flags for user token action

func (*UserTokenAction) Apply

Apply the current action.

func (*UserTokenAction) Description

func (o *UserTokenAction) Description() string

Description for the current command.

func (*UserTokenAction) GetFlags

func (o *UserTokenAction) GetFlags() *flag.FlagSet

GetFlags for the current command.

Jump to

Keyboard shortcuts

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