bot

package
v0.0.0-...-26835a4 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgResponseType byte = 0x02
	MsgPushType     byte = 0x03
)

FIXME - constants from internal pitaya package

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot interface {
	Initialize() error
	Run() error
	Finalize() error
	Connect(...string) error
	Disconnect()
	Reconnect()
}

Bot defines the interface the bots must implement

func NewSequentialBot

func NewSequentialBot(config *viper.Viper, spec *models.Spec, id int, mr []metrics.Reporter, logger logrus.FieldLogger) (Bot, error)

NewSequentialBot returns a new sequantial bot instance

type ExpectError

type ExpectError struct {
	Err     error
	RawData []byte
	Expect  string
}

ExpectError ...

func NewExpectError

func NewExpectError(err error, rawData []byte, expect models.ExpectSpec) *ExpectError

NewExpectError ...

func (*ExpectError) Error

func (b *ExpectError) Error() string

type Expr

type Expr string

Expr is the expression which contains the tokens to access the object value

type PClient

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

PClient is a wrapper around pitaya/client. The ideia is to be able to separate request/responses from server pushes

func NewPClient

func NewPClient(host string, useTLS bool, docs string, pushinfo map[string]string) (*PClient, error)

NewPClient is the PCLient constructor

func (*PClient) Connected

func (c *PClient) Connected() bool

Connected returns if the given client is connected or not

func (*PClient) Disconnect

func (c *PClient) Disconnect()

Disconnect disconnects the client

func (*PClient) Notify

func (c *PClient) Notify(route string, data []byte) error

Notify sends a notify to the server

func (*PClient) ReceivePush

func (c *PClient) ReceivePush(route string, timeout int) (Response, error)

ReceivePush ...

func (*PClient) Request

func (c *PClient) Request(route string, data []byte) (Response, []byte, error)

Request ...

func (*PClient) StartListening

func (c *PClient) StartListening()

StartListening ...

type Response

type Response interface{}

Response is the response received from the pitaya server being tested

type SequentialBot

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

SequentialBot defines the struct for the sequential bot that is going to run

func (*SequentialBot) Connect

func (b *SequentialBot) Connect(hosts ...string) error

Connect ...

func (*SequentialBot) Disconnect

func (b *SequentialBot) Disconnect()

Disconnect ...

func (*SequentialBot) Finalize

func (b *SequentialBot) Finalize() error

Finalize finalizes the bot

func (*SequentialBot) Initialize

func (b *SequentialBot) Initialize() error

Initialize initializes the bot

func (*SequentialBot) Reconnect

func (b *SequentialBot) Reconnect()

Reconnect ...

func (*SequentialBot) Run

func (b *SequentialBot) Run() (err error)

Run runs the bot

Jump to

Keyboard shortcuts

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