Documentation ¶
Index ¶
- type ActionController
- type AlertController
- type Controller
- type StationController
- type StopController
- func (c *StopController) BeforePost()
- func (c *StopController) CGetByStation(stationID int, f *filters.Stop)
- func (c *StopController) CGetByTrain(code string, f *filters.Pagination)
- func (c *StopController) Head(stationID uint, code string)
- func (c *StopController) Post(stationID uint, code string, i *models.StopInput)
- type TrainController
- type UserController
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 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 ¶
func (c *StationController) Post(i *models.StationInput)
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
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) 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