controllers

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2017 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionController

type ActionController struct {
	Controller
}

ActionController regroup all endpoints concern action

func (*ActionController) BeforePost

func (c *ActionController) BeforePost()

BeforePost verify if the user is allowed to create an action

func (*ActionController) Post

func (c *ActionController) Post(i *models.ActionInput)

Post create a new action

type AlertController

type AlertController struct {
	Controller
}

AlertController regroup all endpoints concern alert

func (*AlertController) BeforeCGet

func (c *AlertController) BeforeCGet()

BeforeCGet verify user is allowed to get all alerts

func (*AlertController) BeforePost

func (c *AlertController) BeforePost()

BeforePost verify if user is allowed to create an alert

func (*AlertController) CGet

func (c *AlertController) CGet(f *filters.Alert)

CGet returns alerts filtered

func (*AlertController) Post

func (c *AlertController) Post(stationID int, code string, i *models.AlertInput)

Post create a new alert

type Controller

type Controller struct {
	*aah.Context
}

Controller extend aah.Context

type StationController

type StationController struct {
	Controller
}

StationController regroup all endpoints concern station

func (*StationController) BeforePost

func (c *StationController) BeforePost()

BeforePost verify if user is allowed to create a train

func (*StationController) CGet

func (c *StationController) CGet(f *filters.Station)

CGet regroup list of stations

func (*StationController) Get

func (c *StationController) Get(stationID uint)

Get return one station

func (*StationController) Post

Post create a new train

type StopController

type StopController struct {
	Controller
}

StopController regroup all endpoints concern stop

func (*StopController) BeforePost

func (c *StopController) BeforePost()

BeforePost verify is user is allowed to link station with a train

func (*StopController) CGetByStation

func (c *StopController) CGetByStation(stationID int, f *filters.Stop)

CGetByStation return all stops for one given station

func (*StopController) CGetByTrain

func (c *StopController) CGetByTrain(code string, f *filters.Pagination)

CGetByTrain return all stops for one given train

func (*StopController) Head

func (c *StopController) Head(stationID uint, code string)

Head allow to know is specific station is deserve by a train

func (*StopController) Post

func (c *StopController) Post(stationID uint, code string, i *models.StopInput)

Post allow to create new stop between one station and one train

type TrainController

type TrainController struct {
	Controller
}

TrainController regroup all endpoints for train

func (*TrainController) BeforePost

func (c *TrainController) BeforePost()

BeforePost assure user has role 'admin' before execute Post method

func (*TrainController) Get

func (c *TrainController) Get(code string)

Get return one train

func (*TrainController) Head

func (c *TrainController) Head(code string)

Head return 204 if train exist

func (*TrainController) Post

func (c *TrainController) Post(i *models.TrainInput)

Post create new train

type UserController

type UserController struct {
	Controller
}

UserController regroup all endpoints concern the user

func (*UserController) Post

func (c *UserController) Post(i *models.UserInput)

Post create new user

func (*UserController) Token

func (c *UserController) Token(t *models.UserToken)

Token authenticate one user

Jump to

Keyboard shortcuts

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