controllers

package
v0.0.0-...-77a769f Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EVENT_JOIN = iota
	EVENT_LEAVE
	EVENT_MESSAGE
)

Variables

This section is empty.

Functions

func BroadcastEvent

func BroadcastEvent(event Event)

func Join

func Join(email string, ws *websocket.Conn)

*

  • Create join and leave funcs

func Leave

func Leave(email string)

func NewArchive

func NewArchive(event Event)

Types

type AlertsApiController

type AlertsApiController struct {
	MainController
}

operations for Alerts.Go

func (*AlertsApiController) Delete

func (this *AlertsApiController) Delete()

@Title Delete @Description delete the Alerts.Go @Param id path string true "The id you want to delete" @Success 200 {string} delete success! @Failure 403 id is empty @router /:id [delete]

func (*AlertsApiController) Get

func (this *AlertsApiController) Get()

func (*AlertsApiController) GetAll

func (this *AlertsApiController) GetAll()

@Title Get All @Description get Alerts.Go @Param query query string false "Filter. e.g. col1:v1,col2:v2 ..." @Param fields query string false "Fields returned. e.g. col1,col2 ..." @Param sortby query string false "Sorted-by fields. e.g. col1,col2 ..." @Param order query string false "Order corresponding to each sortby field, if single value, apply to all sortby fields. e.g. desc,asc ..." @Param limit query string false "Limit the size of result set. Must be an integer" @Param offset query string false "Start position of result set. Must be an integer" @Success 200 {object} models.Alerts.Go @Failure 403 @router / [get]

func (*AlertsApiController) GetOne

func (this *AlertsApiController) GetOne()

@Title Get @Description get Alerts.Go by id @Param id path string true "The key for staticblock" @Success 200 {object} models.Alerts.Go @Failure 403 :id is empty @router /:id [get]

func (*AlertsApiController) GetRecent

func (this *AlertsApiController) GetRecent()

func (*AlertsApiController) Post

func (this *AlertsApiController) Post()

@Title Post @Description create Alerts.Go @Param body body models.Alerts.Go true "body for Alerts.Go content" @Success 200 {int} models.Alerts.Go.Id @Failure 403 body is empty @router / [post]

func (*AlertsApiController) Put

func (this *AlertsApiController) Put()

@Title Update @Description update the Alerts.Go @Param id path string true "The id you want to update" @Param body body models.Alerts.Go true "body for Alerts.Go content" @Success 200 {object} models.Alerts.Go @Failure 403 :id is not int @router /:id [put]

func (*AlertsApiController) URLMapping

func (this *AlertsApiController) URLMapping()

type ApplicationTypesApiController

type ApplicationTypesApiController struct {
	MainController
}

operations for Monitors.Go

func (*ApplicationTypesApiController) Delete

func (this *ApplicationTypesApiController) Delete()

@Title Delete @Description delete the Monitors.Go @Param id path string true "The id you want to delete" @Success 200 {string} delete success! @Failure 403 id is empty @router /:id [delete]

func (*ApplicationTypesApiController) Get

func (this *ApplicationTypesApiController) Get()

func (*ApplicationTypesApiController) GetAll

func (this *ApplicationTypesApiController) GetAll()

@Title Get All @Description get Monitors.Go @Param query query string false "Filter. e.g. col1:v1,col2:v2 ..." @Param fields query string false "Fields returned. e.g. col1,col2 ..." @Param sortby query string false "Sorted-by fields. e.g. col1,col2 ..." @Param order query string false "Order corresponding to each sortby field, if single value, apply to all sortby fields. e.g. desc,asc ..." @Param limit query string false "Limit the size of result set. Must be an integer" @Param offset query string false "Start position of result set. Must be an integer" @Success 200 {object} models.Monitors.Go @Failure 403 @router / [get]

func (*ApplicationTypesApiController) GetOne

func (this *ApplicationTypesApiController) GetOne()

@Title Get @Description get Monitors.Go by id @Param id path string true "The key for staticblock" @Success 200 {object} models.Monitors.Go @Failure 403 :id is empty @router /:id [get]

func (*ApplicationTypesApiController) Post

func (this *ApplicationTypesApiController) Post()

@Title Post @Description create Monitors.Go @Param body body models.Monitors.Go true "body for Monitors.Go content" @Success 200 {int} models.Monitors.Go.Id @Failure 403 body is empty @router / [post]

func (*ApplicationTypesApiController) Put

func (this *ApplicationTypesApiController) Put()

@Title Update @Description update the Monitors.Go @Param id path string true "The id you want to update" @Param body body models.Monitors.Go true "body for Monitors.Go content" @Success 200 {object} models.Monitors.Go @Failure 403 :id is not int @router /:id [put]

func (*ApplicationTypesApiController) URLMapping

func (this *ApplicationTypesApiController) URLMapping()

type ContactsApiController

type ContactsApiController struct {
	MainController
}

operations for Sites.Go

func (*ContactsApiController) Delete

func (this *ContactsApiController) Delete()

@Title Delete @Description delete the Sites.Go @Param id path string true "The id you want to delete" @Success 200 {string} delete success! @Failure 403 id is empty @router /:id [delete]

func (*ContactsApiController) Get

func (this *ContactsApiController) Get()

func (*ContactsApiController) GetAll

func (this *ContactsApiController) GetAll()

@Title Get All @Description get Sites.Go @Param query query string false "Filter. e.g. col1:v1,col2:v2 ..." @Param fields query string false "Fields returned. e.g. col1,col2 ..." @Param sortby query string false "Sorted-by fields. e.g. col1,col2 ..." @Param order query string false "Order corresponding to each sortby field, if single value, apply to all sortby fields. e.g. desc,asc ..." @Param limit query string false "Limit the size of result set. Must be an integer" @Param offset query string false "Start position of result set. Must be an integer" @Success 200 {object} models.Sites.Go @Failure 403 @router / [get]

func (*ContactsApiController) GetOne

func (this *ContactsApiController) GetOne()

@Title Get @Description get Sites.Go by id @Param id path string true "The key for staticblock" @Success 200 {object} models.Sites.Go @Failure 403 :id is empty @router /:id [get]

func (*ContactsApiController) Post

func (this *ContactsApiController) Post()

@Title Post @Description create Sites.Go @Param body body models.Sites.Go true "body for Sites.Go content" @Success 200 {int} models.Sites.Go.Id @Failure 403 body is empty @router / [post]

func (*ContactsApiController) Put

func (this *ContactsApiController) Put()

@Title Update @Description update the Sites.Go @Param id path string true "The id you want to update" @Param body body models.Sites.Go true "body for Sites.Go content" @Success 200 {object} models.Sites.Go @Failure 403 :id is not int @router /:id [put]

func (*ContactsApiController) URLMapping

func (this *ContactsApiController) URLMapping()

type Event

type Event struct {
	Name  string
	Email string
	Fired int
	Data  []EventData
	// contains filtered or unexported fields
}

func GetEvents

func GetEvents(lastReceived int) []Event

func NewEvent

func NewEvent(name string, email string, data []EventData) Event

*

  • Basic Archive & Event functions

type EventData

type EventData interface{}

*

  • Register Event Types

type EventsApiController

type EventsApiController struct {
	MainController
}

operations for Sites.Go

func (*EventsApiController) AddNew

func (this *EventsApiController) AddNew() bool

func (*EventsApiController) Delete

func (this *EventsApiController) Delete()

@Title Delete @Description delete the Sites.Go @Param id path string true "The id you want to delete" @Success 200 {string} delete success! @Failure 403 id is empty @router /:id [delete]

func (*EventsApiController) GetAll

func (this *EventsApiController) GetAll()

@Title Get All @Description get Sites.Go @Param query query string false "Filter. e.g. col1:v1,col2:v2 ..." @Param fields query string false "Fields returned. e.g. col1,col2 ..." @Param sortby query string false "Sorted-by fields. e.g. col1,col2 ..." @Param order query string false "Order corresponding to each sortby field, if single value, apply to all sortby fields. e.g. desc,asc ..." @Param limit query string false "Limit the size of result set. Must be an integer" @Param offset query string false "Start position of result set. Must be an integer" @Success 200 {object} models.Sites.Go @Failure 403 @router / [get]

func (*EventsApiController) GetOne

func (this *EventsApiController) GetOne()

@Title Get @Description get Sites.Go by id @Param id path string true "The key for staticblock" @Success 200 {object} models.Sites.Go @Failure 403 :id is empty @router /:id [get]

func (*EventsApiController) Post

func (this *EventsApiController) Post()

@Title Post @Description create Sites.Go @Param body body models.Sites.Go true "body for Sites.Go content" @Success 200 {int} models.Sites.Go.Id @Failure 403 body is empty @router / [post]

func (*EventsApiController) Put

func (this *EventsApiController) Put()

@Title Update @Description update the Sites.Go @Param id path string true "The id you want to update" @Param body body models.Sites.Go true "body for Sites.Go content" @Success 200 {object} models.Sites.Go @Failure 403 :id is not int @router /:id [put]

func (*EventsApiController) URLMapping

func (this *EventsApiController) URLMapping()

type GroupsApiController

type GroupsApiController struct {
	MainController
}

operations for Sites.Go

func (*GroupsApiController) Delete

func (this *GroupsApiController) Delete()

@Title Delete @Description delete the Sites.Go @Param id path string true "The id you want to delete" @Success 200 {string} delete success! @Failure 403 id is empty @router /:id [delete]

func (*GroupsApiController) Get

func (this *GroupsApiController) Get()

func (*GroupsApiController) GetAll

func (this *GroupsApiController) GetAll()

@Title Get All @Description get Sites.Go @Param query query string false "Filter. e.g. col1:v1,col2:v2 ..." @Param fields query string false "Fields returned. e.g. col1,col2 ..." @Param sortby query string false "Sorted-by fields. e.g. col1,col2 ..." @Param order query string false "Order corresponding to each sortby field, if single value, apply to all sortby fields. e.g. desc,asc ..." @Param limit query string false "Limit the size of result set. Must be an integer" @Param offset query string false "Start position of result set. Must be an integer" @Success 200 {object} models.Sites.Go @Failure 403 @router / [get]

func (*GroupsApiController) GetOne

func (this *GroupsApiController) GetOne()

@Title Get @Description get Sites.Go by id @Param id path string true "The key for staticblock" @Success 200 {object} models.Sites.Go @Failure 403 :id is empty @router /:id [get]

func (*GroupsApiController) Post

func (this *GroupsApiController) Post()

@Title Post @Description create Sites.Go @Param body body models.Sites.Go true "body for Sites.Go content" @Success 200 {int} models.Sites.Go.Id @Failure 403 body is empty @router / [post]

func (*GroupsApiController) Put

func (this *GroupsApiController) Put()

@Title Update @Description update the Sites.Go @Param id path string true "The id you want to update" @Param body body models.Sites.Go true "body for Sites.Go content" @Success 200 {object} models.Sites.Go @Failure 403 :id is not int @router /:id [put]

func (*GroupsApiController) SaveContacts

func (this *GroupsApiController) SaveContacts()

func (*GroupsApiController) URLMapping

func (this *GroupsApiController) URLMapping()

type LiveController

type LiveController struct {
	MainController
}

func (*LiveController) Join

func (this *LiveController) Join()

*

  • Define the funcs that respond to particular routes.

type MainController

type MainController struct {
	beego.Controller
}

func (*MainController) Get

func (this *MainController) Get()

func (*MainController) Notice

func (this *MainController) Notice()

func (*MainController) Test

func (this *MainController) Test()

type MonitorRunsApiController

type MonitorRunsApiController struct {
	MainController
}

operations for Monitors.Go

func (*MonitorRunsApiController) Delete

func (this *MonitorRunsApiController) Delete()

@Title Delete @Description delete the Monitors.Go @Param id path string true "The id you want to delete" @Success 200 {string} delete success! @Failure 403 id is empty @router /:id [delete]

func (*MonitorRunsApiController) Get

func (this *MonitorRunsApiController) Get()

func (*MonitorRunsApiController) GetAll

func (this *MonitorRunsApiController) GetAll()

@Title Get All @Description get Monitors.Go @Param query query string false "Filter. e.g. col1:v1,col2:v2 ..." @Param fields query string false "Fields returned. e.g. col1,col2 ..." @Param sortby query string false "Sorted-by fields. e.g. col1,col2 ..." @Param order query string false "Order corresponding to each sortby field, if single value, apply to all sortby fields. e.g. desc,asc ..." @Param limit query string false "Limit the size of result set. Must be an integer" @Param offset query string false "Start position of result set. Must be an integer" @Success 200 {object} models.Monitors.Go @Failure 403 @router / [get]

func (*MonitorRunsApiController) GetOne

func (this *MonitorRunsApiController) GetOne()

@Title Get @Description get Monitors.Go by id @Param id path string true "The key for staticblock" @Success 200 {object} models.Monitors.Go @Failure 403 :id is empty @router /:id [get]

func (*MonitorRunsApiController) Post

func (this *MonitorRunsApiController) Post()

@Title Post @Description create Monitors.Go @Param body body models.Monitors.Go true "body for Monitors.Go content" @Success 200 {int} models.Monitors.Go.Id @Failure 403 body is empty @router / [post]

func (*MonitorRunsApiController) Put

func (this *MonitorRunsApiController) Put()

@Title Update @Description update the Monitors.Go @Param id path string true "The id you want to update" @Param body body models.Monitors.Go true "body for Monitors.Go content" @Success 200 {object} models.Monitors.Go @Failure 403 :id is not int @router /:id [put]

func (*MonitorRunsApiController) URLMapping

func (this *MonitorRunsApiController) URLMapping()

type MonitorsApiController

type MonitorsApiController struct {
	MainController
}

operations for Monitors.Go

func (*MonitorsApiController) Delete

func (this *MonitorsApiController) Delete()

@Title Delete @Description delete the Monitors.Go @Param id path string true "The id you want to delete" @Success 200 {string} delete success! @Failure 403 id is empty @router /:id [delete]

func (*MonitorsApiController) Get

func (this *MonitorsApiController) Get()

func (*MonitorsApiController) GetAll

func (this *MonitorsApiController) GetAll()

@Title Get All @Description get Monitors.Go @Param query query string false "Filter. e.g. col1:v1,col2:v2 ..." @Param fields query string false "Fields returned. e.g. col1,col2 ..." @Param sortby query string false "Sorted-by fields. e.g. col1,col2 ..." @Param order query string false "Order corresponding to each sortby field, if single value, apply to all sortby fields. e.g. desc,asc ..." @Param limit query string false "Limit the size of result set. Must be an integer" @Param offset query string false "Start position of result set. Must be an integer" @Success 200 {object} models.Monitors.Go @Failure 403 @router / [get]

func (*MonitorsApiController) GetOne

func (this *MonitorsApiController) GetOne()

@Title Get @Description get Monitors.Go by id @Param id path string true "The key for staticblock" @Success 200 {object} models.Monitors.Go @Failure 403 :id is empty @router /:id [get]

func (*MonitorsApiController) Post

func (this *MonitorsApiController) Post()

@Title Post @Description create Monitors.Go @Param body body models.Monitors.Go true "body for Monitors.Go content" @Success 200 {int} models.Monitors.Go.Id @Failure 403 body is empty @router / [post]

func (*MonitorsApiController) Put

func (this *MonitorsApiController) Put()

@Title Update @Description update the Monitors.Go @Param id path string true "The id you want to update" @Param body body models.Monitors.Go true "body for Monitors.Go content" @Success 200 {object} models.Monitors.Go @Failure 403 :id is not int @router /:id [put]

func (*MonitorsApiController) URLMapping

func (this *MonitorsApiController) URLMapping()

type SitesApiController

type SitesApiController struct {
	MainController
}

operations for Sites.Go

func (*SitesApiController) Delete

func (this *SitesApiController) Delete()

@Title Delete @Description delete the Sites.Go @Param id path string true "The id you want to delete" @Success 200 {string} delete success! @Failure 403 id is empty @router /:id [delete]

func (*SitesApiController) Get

func (this *SitesApiController) Get()

func (*SitesApiController) GetAll

func (this *SitesApiController) GetAll()

@Title Get All @Description get Sites.Go @Param query query string false "Filter. e.g. col1:v1,col2:v2 ..." @Param fields query string false "Fields returned. e.g. col1,col2 ..." @Param sortby query string false "Sorted-by fields. e.g. col1,col2 ..." @Param order query string false "Order corresponding to each sortby field, if single value, apply to all sortby fields. e.g. desc,asc ..." @Param limit query string false "Limit the size of result set. Must be an integer" @Param offset query string false "Start position of result set. Must be an integer" @Success 200 {object} models.Sites.Go @Failure 403 @router / [get]

func (*SitesApiController) GetOne

func (this *SitesApiController) GetOne()

@Title Get @Description get Sites.Go by id @Param id path string true "The key for staticblock" @Success 200 {object} models.Sites.Go @Failure 403 :id is empty @router /:id [get]

func (*SitesApiController) Post

func (this *SitesApiController) Post()

@Title Post @Description create Sites.Go @Param body body models.Sites.Go true "body for Sites.Go content" @Success 200 {int} models.Sites.Go.Id @Failure 403 body is empty @router / [post]

func (*SitesApiController) Put

func (this *SitesApiController) Put()

@Title Update @Description update the Sites.Go @Param id path string true "The id you want to update" @Param body body models.Sites.Go true "body for Sites.Go content" @Success 200 {object} models.Sites.Go @Failure 403 :id is not int @router /:id [put]

func (*SitesApiController) URLMapping

func (this *SitesApiController) URLMapping()

type Subscriber

type Subscriber struct {
	Email string
	Conn  *websocket.Conn
}

*

  • Register subscription and subscriber types

type Subscription

type Subscription struct {
	Archive []Event      // All the events from the archive.
	New     <-chan Event // New events coming in.
}

type UserController

type UserController struct {
	MainController
}

func (*UserController) Login

func (this *UserController) Login()

func (*UserController) Logout

func (this *UserController) Logout()

func (*UserController) Profile

func (this *UserController) Profile()

func (*UserController) Register

func (this *UserController) Register()

func (*UserController) Remove

func (this *UserController) Remove()

func (*UserController) Verify

func (this *UserController) Verify()

Jump to

Keyboard shortcuts

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