actions

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionType

type ActionType string
const (
	LoginActionType         ActionType = "-login"
	DeleteUserActionType    ActionType = "-delete-user"
	AddFileActionType       ActionType = "-add"
	RemoveFileActionType    ActionType = "-remove"
	ListFilesActionType     ActionType = "-list"
	DownloadFilesActionType ActionType = "-download"
	UploadFilesActionType   ActionType = "-upload"
)

type AddFileAction

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

func (*AddFileAction) Exec

func (a *AddFileAction) Exec(output io.Writer, args ...any) error

func (*AddFileAction) HasArgs

func (a *AddFileAction) HasArgs() bool

func (*AddFileAction) NeedsRoot

func (a *AddFileAction) NeedsRoot() bool

type DeleteUserAction

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

func (*DeleteUserAction) Exec

func (d *DeleteUserAction) Exec(output io.Writer, args ...any) error

func (*DeleteUserAction) HasArgs

func (d *DeleteUserAction) HasArgs() bool

func (*DeleteUserAction) NeedsRoot

func (d *DeleteUserAction) NeedsRoot() bool

type DownloadFilesAction

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

func (*DownloadFilesAction) Exec

func (d *DownloadFilesAction) Exec(output io.Writer, args ...any) error

func (*DownloadFilesAction) HasArgs

func (d *DownloadFilesAction) HasArgs() bool

func (*DownloadFilesAction) NeedsRoot

func (d *DownloadFilesAction) NeedsRoot() bool

type IAction

type IAction interface {
	// Exec executes the selected action, and prints action's output on the given io.Writer
	// or exits with an error
	Exec(output io.Writer, args ...any) error

	// NeedsRoot return true if the action needs root to be executed
	NeedsRoot() bool

	// HasArgs returns true if the action requires arguments to run
	HasArgs() bool
}

func GetAction

func GetAction(at ActionType) IAction

func NewAddFileAction

func NewAddFileAction() IAction

func NewDeleteUserAction

func NewDeleteUserAction() IAction

func NewDownloadFilesAction

func NewDownloadFilesAction() IAction

func NewListFilesAction

func NewListFilesAction() IAction

func NewLoginAction

func NewLoginAction() IAction

func NewRemoveFileAction

func NewRemoveFileAction() IAction

func NewUploadFilesAction

func NewUploadFilesAction() IAction

type ListFilesAction

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

func (*ListFilesAction) Exec

func (l *ListFilesAction) Exec(output io.Writer, args ...any) error

func (*ListFilesAction) HasArgs

func (l *ListFilesAction) HasArgs() bool

func (*ListFilesAction) NeedsRoot

func (l *ListFilesAction) NeedsRoot() bool

type LoginAction

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

func (*LoginAction) Exec

func (l *LoginAction) Exec(output io.Writer, args ...any) error

func (*LoginAction) HasArgs

func (l *LoginAction) HasArgs() bool

func (*LoginAction) NeedsRoot

func (l *LoginAction) NeedsRoot() bool

type RemoveFileAction

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

func (*RemoveFileAction) Exec

func (r *RemoveFileAction) Exec(output io.Writer, args ...any) error

func (*RemoveFileAction) HasArgs

func (r *RemoveFileAction) HasArgs() bool

func (*RemoveFileAction) NeedsRoot

func (r *RemoveFileAction) NeedsRoot() bool

type UploadFilesAction

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

func (*UploadFilesAction) Exec

func (u *UploadFilesAction) Exec(output io.Writer, args ...any) error

func (*UploadFilesAction) HasArgs

func (u *UploadFilesAction) HasArgs() bool

func (*UploadFilesAction) NeedsRoot

func (u *UploadFilesAction) NeedsRoot() bool

Jump to

Keyboard shortcuts

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