controllers

package
v0.0.0-...-aa90c1d Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MESSAGE           = 2
	TOTAL             = 3
	P90               = 4
	P99               = 5
	P50               = 6
	RPS               = 7
	SLAVE             = 8
	STOPPED           = 9
	USERS             = 10
	ERROR             = 11
	CLOSED_CONNECTION = 1
	MSG               = 2
	STOP_TEST         = 3
)

Constants for type of message

Variables

This section is empty.

Functions

func Join

func Join(ws *websocket.Conn)

Join method called for new connections

func Leave

func Leave(ws *websocket.Conn)

Leave method to remove the client from socketlist

Types

type Event

type Event struct {
	Type    int
	Content string
}

Event object is sent to the websocket

type HomeController

type HomeController struct {
	beego.Controller
}

HomeController : controller

func (*HomeController) Get

func (c *HomeController) Get()

Get request

func (*HomeController) Join

func (c *HomeController) Join()

Join creates a new websocket object for a new client and adds to subsriber list

func (*HomeController) Post

func (c *HomeController) Post()

Post request

type Request

type Request struct {
	MType   int
	URL     string
	Headers []string
	Method  string
	Payload string
	Users   int
	Slave   int
}

Request struct for tcp message

type RequestDetails

type RequestDetails struct {
	URL      string `form:"url" valid:"Required"`
	Headers  string `form:"headers"`
	Method   string `form:"method" valid:"Required"`
	Payload  string `form:"payload"`
	Users    int    `form:"users" valid:"Required"`
	Duration int    `form:"duration"`
	Format   string `form:"format"`
	RampType string `form:"ramp-type"`
	RampTime int    `form:"ramp"`
	RampStep string `form:"step"`
}

RequestDetails form details

type Resp

type Resp struct {
	MType   int
	Content string
}

Resp received from clients

type Stop

type Stop struct {
	MType int
}

Stop object sent to clients

type Subscriber

type Subscriber struct {
	Conn *websocket.Conn // Only for WebSocket users; otherwise nil.
}

Subscriber obj

type Writer

type Writer struct {
	Conn net.Conn
}

Writer contains a tcp socket connection object

Jump to

Keyboard shortcuts

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