cmd

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2022 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NetworkTimeoutError   = errors.New(toBoldRed("TIMEOUT NETWORK ERROR: Make sure you have internet connection."))
	NetworkTemporaryError = errors.New(toBoldRed("TEMPORARY NETWORK ERROR: Make sure you have internet connection."))
	InputError            = errors.New(toBoldRed("INPUT ERROR: Make sure you entered a correct type argument."))
	ApiKeyMissing         = errors.New(toBoldRed("API_KEY is empty, provide one with the auth command"))
)

Functions

func Helper

func Helper(name, description string, tw *tabwriter.Writer)

Types

type AdminConfig

type AdminConfig Command

func NewAdminConfigCmd

func NewAdminConfigCmd() *AdminConfig

func (*AdminConfig) ActivateSubcommand

func (c *AdminConfig) ActivateSubcommand(name string) error

ActivateSubcommand ...

func (*AdminConfig) Helper

func (c *AdminConfig) Helper(tw *tabwriter.Writer)

Helper display info about the command

func (*AdminConfig) Run

Run execute the command

func (*AdminConfig) SetData

func (c *AdminConfig) SetData(data string)

SetData ...

func (*AdminConfig) Validate

func (c *AdminConfig) Validate() CommandValidationError

Validate execute the command

type ArticlesCommand

type ArticlesCommand Command

func NewArticlesCmd

func NewArticlesCmd() *ArticlesCommand

func (*ArticlesCommand) ActivateSubcommand

func (c *ArticlesCommand) ActivateSubcommand(name string) error

ActivateSubcommand ...

func (*ArticlesCommand) Helper

func (c *ArticlesCommand) Helper(tw *tabwriter.Writer)

Helper display info about the command

func (*ArticlesCommand) Run

Run execute the command

func (*ArticlesCommand) SetData

func (c *ArticlesCommand) SetData(data string)

SetData ...

func (*ArticlesCommand) Validate

Validate check for the preconditions to execute this command

type AuthCommand

type AuthCommand Command

func NewAuthCmd

func NewAuthCmd() *AuthCommand

func (*AuthCommand) Helper

func (c *AuthCommand) Helper(tw *tabwriter.Writer)

Helper display info about the command

func (*AuthCommand) Run

Run execute the command

func (*AuthCommand) SetData

func (c *AuthCommand) SetData(data string)

SetData ...

func (*AuthCommand) Validate

func (c *AuthCommand) Validate() CommandValidationError

Validate check for the preconditions to execute this command

type Command

type Command struct {
	Name        string
	Description string
	Data        string
	Subcommands map[string]*Subcommand
}

Command main struture for a command

func (*Command) ActivateSubcommand

func (c *Command) ActivateSubcommand(name string) error

ActivateSubcommand ...

type CommandI

type CommandI interface {
	Run() CommandValidationError
	Helper(*tabwriter.Writer)
}

CommandI actions that can be excecuted by a Command

type CommandLine

type CommandLine struct {
	Commands []CommandI
	// contains filtered or unexported fields
}
var (
	Cli *CommandLine
)

func NewCli

func NewCli() *CommandLine

func (*CommandLine) Execute

func (cli *CommandLine) Execute()

type CommandValidationError

type CommandValidationError error

CommandValidationError ...

func NewCommandError

func NewCommandError(description string) CommandValidationError

NewCommandError ...

type CommentsCommand

type CommentsCommand Command

func NewCommentsCommand

func NewCommentsCommand() *CommentsCommand

func (*CommentsCommand) ActivateSubcommand

func (c *CommentsCommand) ActivateSubcommand(name string) error

ActivateSubcommand ...

func (*CommentsCommand) Helper

func (c *CommentsCommand) Helper(tw *tabwriter.Writer)

Helper display info about the command

func (*CommentsCommand) Run

Run execute the command

func (*CommentsCommand) SetData

func (c *CommentsCommand) SetData(data string)

SetData ...

func (*CommentsCommand) Validate

Validate check for the preconditions to execute this command

type FollowersCommand

type FollowersCommand Command

func NewFollowersCommand

func NewFollowersCommand() *FollowersCommand

func (*FollowersCommand) ActivateSubcommand

func (c *FollowersCommand) ActivateSubcommand(name string) error

ActivateSubcommand ...

func (*FollowersCommand) Helper

func (c *FollowersCommand) Helper(tw *tabwriter.Writer)

Helper display info about the command

func (*FollowersCommand) Run

Run execute the command

func (*FollowersCommand) SetData

func (c *FollowersCommand) SetData(data string)

SetData ...

func (*FollowersCommand) Validate

Validate check for the preconditions to execute this command

type ListingsCommand

type ListingsCommand Command

func NewListingsCommand

func NewListingsCommand() *ListingsCommand

func (*ListingsCommand) ActivateSubcommand

func (c *ListingsCommand) ActivateSubcommand(name string) error

ActivateSubcommand ...

func (*ListingsCommand) Helper

func (c *ListingsCommand) Helper(tw *tabwriter.Writer)

Helper display info about the command

func (*ListingsCommand) Run

Run execute the command

func (*ListingsCommand) SetData

func (c *ListingsCommand) SetData(data string)

SetData ...

func (*ListingsCommand) Validate

Validate check for the preconditions to execute this command

type OrganizationsCommand

type OrganizationsCommand Command

func NewOrganizationsCommand

func NewOrganizationsCommand() *OrganizationsCommand

func (*OrganizationsCommand) ActivateSubcommand

func (c *OrganizationsCommand) ActivateSubcommand(name string) error

ActivateSubcommand ...

func (*OrganizationsCommand) Helper

func (c *OrganizationsCommand) Helper(tw *tabwriter.Writer)

Helper display info about the command

func (*OrganizationsCommand) Run

Run execute the command

func (*OrganizationsCommand) SetData

func (c *OrganizationsCommand) SetData(data string)

SetData ...

func (*OrganizationsCommand) Validate

Validate check for the preconditions to execute this command

type PodcastsCommand

type PodcastsCommand Command

func NewPodcastsCommand

func NewPodcastsCommand() *PodcastsCommand

func (*PodcastsCommand) ActivateSubcommand

func (c *PodcastsCommand) ActivateSubcommand(name string) error

ActivateSubcommand ...

func (*PodcastsCommand) Helper

func (c *PodcastsCommand) Helper(tw *tabwriter.Writer)

Helper display info about the command

func (*PodcastsCommand) Run

Run execute the command

func (*PodcastsCommand) SetData

func (c *PodcastsCommand) SetData(data string)

SetData ...

func (*PodcastsCommand) Validate

Validate check for the preconditions to execute this command

type ProfileImageCommand

type ProfileImageCommand Command

func NewProfileImageCmd

func NewProfileImageCmd() *ProfileImageCommand

func (*ProfileImageCommand) ActivateSubcommand

func (c *ProfileImageCommand) ActivateSubcommand(name string) error

ActivateSubcommand ...

func (*ProfileImageCommand) Helper

func (c *ProfileImageCommand) Helper(tw *tabwriter.Writer)

Helper display info about the command

func (*ProfileImageCommand) Run

Run execute the command

func (*ProfileImageCommand) SetData

func (c *ProfileImageCommand) SetData(data string)

SetData ...

func (*ProfileImageCommand) Validate

Validate check for the preconditions to execute this command

type ReadingListsCommand

type ReadingListsCommand Command

func NewReadingListsCommand

func NewReadingListsCommand() *ReadingListsCommand

func (*ReadingListsCommand) ActivateSubcommand

func (c *ReadingListsCommand) ActivateSubcommand(name string) error

ActivateSubcommand ...

func (*ReadingListsCommand) Helper

func (c *ReadingListsCommand) Helper(tw *tabwriter.Writer)

Helper display info about the command

func (*ReadingListsCommand) Run

Run execute the command

func (*ReadingListsCommand) SetData

func (c *ReadingListsCommand) SetData(data string)

SetData ...

func (*ReadingListsCommand) Validate

Validate check for the preconditions to execute this command

type Subcommand

type Subcommand struct {
	Description string
	Active      bool
}

type TagsCommand

type TagsCommand Command

func NewTagsCommand

func NewTagsCommand() *TagsCommand

func (*TagsCommand) ActivateSubcommand

func (c *TagsCommand) ActivateSubcommand(name string) error

ActivateSubcommand ...

func (*TagsCommand) Helper

func (c *TagsCommand) Helper(tw *tabwriter.Writer)

Helper display info about the command

func (*TagsCommand) Run

Run execute the command

func (*TagsCommand) SetData

func (c *TagsCommand) SetData(data string)

SetData ...

func (*TagsCommand) Validate

func (c *TagsCommand) Validate() CommandValidationError

Validate check for the preconditions to execute this command

type WebhooksCommand

type WebhooksCommand Command

func NewWebhooksCmd

func NewWebhooksCmd() *WebhooksCommand

func (*WebhooksCommand) ActivateSubcommand

func (c *WebhooksCommand) ActivateSubcommand(name string) error

ActivateSubcommand ...

func (*WebhooksCommand) Helper

func (c *WebhooksCommand) Helper(tw *tabwriter.Writer)

Helper display info about the command

func (*WebhooksCommand) Run

Run execute the command

func (*WebhooksCommand) SetData

func (c *WebhooksCommand) SetData(data string)

SetData ...

func (*WebhooksCommand) Validate

Validate check for the preconditions to execute this command

Jump to

Keyboard shortcuts

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