commands

package
v0.0.0-...-5230034 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package mock_commands is a generated GoMock package.

Index

Constants

View Source
const (
	// AuthCmdName used as key/id for the auth command
	AuthCmdName = "auth"
)
View Source
const (
	// DeleteCmdName used as key/id for the delete command
	DeleteCmdName = "delete"
)
View Source
const (
	// DeployCmdName is used as key/id for the deploy command
	DeployCmdName = "deploy"
)
View Source
const (
	// ReleaseCmdName is the ID/Key for the ReleaseCmd
	ReleaseCmdName = "release"
)
View Source
const (
	RestartCmdName = "restart"
)
View Source
const (
	RunCmdName = "run"
)
View Source
const (
	// SetCmdName id/key
	SetCmdName = "set"
)
View Source
const (
	// ShowCmdName id/key
	ShowCmdName = "show"
)

Variables

This section is empty.

Functions

func CleanUrls

func CleanUrls(input string) string

CleanUrls cleans the incoming URLs this iterates the incoming command and removes any encoding slack adds to URLs

func ExtractArtifactsDefinition

func ExtractArtifactsDefinition(defType string, opts CommandOptions) eve.ArtifactDefinitions

ExtractArtifactsDefinition extracts the ArtifactDefinitions from the CommandOptions

func ExtractBoolOpt

func ExtractBoolOpt(defType string, opts CommandOptions) bool

ExtractBoolOpt extracts a bool key/val from the opts

func ExtractMetadataField

func ExtractMetadataField(opts CommandOptions) eve.MetadataField

func ExtractStringListOpt

func ExtractStringListOpt(defType string, opts CommandOptions) eve.StringList

ExtractStringListOpt extracts a string slice key value from the options

func ExtractStringOpt

func ExtractStringOpt(defType string, opts CommandOptions) string

ExtractStringOpt extracts a string key/val from the options

Types

type ChatChannelInfoFn

type ChatChannelInfoFn func(context.Context, string) (chatmodels.Channel, error)

type ChatInfo

type ChatInfo struct {
	User, Channel, CommandName          string
	IsHelpRequest, IsRootCmd, IsAuthCmd bool
}

ChatInfo contains the Chat Command Info

type CommandOptions

type CommandOptions map[string]interface{}

CommandOptions is the dynamic command options that become Key:Value pairs

type EvebotCommand

type EvebotCommand interface {
	Info() ChatInfo
	Options() CommandOptions
	AckMsg() (string, bool)
}

EvebotCommand interface (each evebot command needs to implement this interface)

func NewAuthCommand

func NewAuthCommand(cmdFields []string, channel, user string) EvebotCommand

NewAuthCommand creates a New AuthCmd that implements the EvebotCommand interface

func NewDeleteCommand

func NewDeleteCommand(cmdFields []string, channel, user string) EvebotCommand

NewDeleteCommand creates a New DeleteCmd that implements the EvebotCommand interface

func NewDeployCommand

func NewDeployCommand(cmdFields []string, channel, user string) EvebotCommand

NewDeployCommand creates a New DeployCmd that implements the EvebotCommand interface

func NewHelpCommand

func NewHelpCommand(cmdFields []string, channel, user string) EvebotCommand

NewHelpCommand creates a New HelpCmd that implements the EvebotCommand interface

func NewInvalidCommand

func NewInvalidCommand(cmdFields []string, channel, user string) EvebotCommand

NewInvalidCommand creates a New InvalidCmd that implements the EvebotCommand interface

func NewReleaseCommand

func NewReleaseCommand(cmdFields []string, channel, user string) EvebotCommand

NewReleaseCommand creates a New ReleaseCmd that implements the EvebotCommand interface

func NewRestartCommand

func NewRestartCommand(cmdFields []string, channel, user string) EvebotCommand

NewRestartCommand creates a New RestartCmd that implements the EvebotCommand interface

func NewRootCmd

func NewRootCmd(cmdFields []string, channel, user string) EvebotCommand

NewRootCmd creates a New RootCmd that implements the EvebotCommand interface

func NewRunCommand

func NewRunCommand(cmdFields []string, channel, user string) EvebotCommand

NewRunCommand creates a New RunCmd that implements the EvebotCommand interface

func NewSetCommand

func NewSetCommand(cmdFields []string, channel, user string) EvebotCommand

NewSetCommand creates a New SetCmd that implements the EvebotCommand interface

func NewShowCommand

func NewShowCommand(cmdFields []string, channel, user string) EvebotCommand

NewShowCommand creates a New ShowCmd that implements the EvebotCommand interface

type Factory

type Factory interface {
	Items() map[string]func(cmdFields []string, channel, user string) EvebotCommand
	NonHelpExamples() help.Examples
	NonHelpCmds() string
}

func NewFactory

func NewFactory() Factory

type InputLengthBounds

type InputLengthBounds struct {
	Min, Max int
}

InputLengthBounds structures the Min/Max

func (*InputLengthBounds) Valid

func (ilb *InputLengthBounds) Valid(input []string) bool

Valid verifies that the input meets the minmum/maximum lengths

func (*InputLengthBounds) ValidMax

func (ilb *InputLengthBounds) ValidMax(input []string) bool

ValidMax verifies that the input is less than or equal to the defined Max value

func (*InputLengthBounds) ValidMin

func (ilb *InputLengthBounds) ValidMin(input []string) bool

ValidMin verifies that the input is greater than or equal to the defined Min value

type MockEvebotCommand

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

MockEvebotCommand is a mock of EvebotCommand interface.

func NewMockEvebotCommand

func NewMockEvebotCommand(ctrl *gomock.Controller) *MockEvebotCommand

NewMockEvebotCommand creates a new mock instance.

func (*MockEvebotCommand) AckMsg

func (m *MockEvebotCommand) AckMsg() (string, bool)

AckMsg mocks base method.

func (*MockEvebotCommand) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockEvebotCommand) Info

func (m *MockEvebotCommand) Info() ChatInfo

Info mocks base method.

func (*MockEvebotCommand) IsAuthenticated

func (m *MockEvebotCommand) IsAuthenticated(chatUserFn *chatmodels.ChatUser, db *dynamodb.DynamoDB) bool

IsAuthenticated mocks base method.

func (*MockEvebotCommand) IsAuthorized

func (m *MockEvebotCommand) IsAuthorized(allowedChannel map[string]interface{}, chatChanFn ChatChannelInfoFn) bool

IsAuthorized mocks base method.

func (*MockEvebotCommand) Options

func (m *MockEvebotCommand) Options() CommandOptions

Options mocks base method.

type MockEvebotCommandMockRecorder

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

MockEvebotCommandMockRecorder is the mock recorder for MockEvebotCommand.

func (*MockEvebotCommandMockRecorder) AckMsg

AckMsg indicates an expected call of AckMsg.

func (*MockEvebotCommandMockRecorder) Info

Info indicates an expected call of Info.

func (*MockEvebotCommandMockRecorder) IsAuthenticated

func (mr *MockEvebotCommandMockRecorder) IsAuthenticated(chatUserFn, db interface{}) *gomock.Call

IsAuthenticated indicates an expected call of IsAuthenticated.

func (*MockEvebotCommandMockRecorder) IsAuthorized

func (mr *MockEvebotCommandMockRecorder) IsAuthorized(allowedChannel, chatChanFn interface{}) *gomock.Call

IsAuthorized indicates an expected call of IsAuthorized.

func (*MockEvebotCommandMockRecorder) Options

func (mr *MockEvebotCommandMockRecorder) Options() *gomock.Call

Options indicates an expected call of Options.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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