Documentation ¶
Index ¶
- Variables
- type BuildData
- type Docs
- type Events
- func (events *Events) AddEvent(response http.ResponseWriter, request *http.Request)
- func (events *Events) DeleteEvent(response http.ResponseWriter, request *http.Request)
- func (events *Events) GetEvent(response http.ResponseWriter, request *http.Request)
- func (events *Events) GetEvents(response http.ResponseWriter, request *http.Request)
- func (events *Events) UpdateEvent(response http.ResponseWriter, request *http.Request)
- func (events *Events) ValidationMiddleware(next http.Handler) http.Handler
- type Home
- type HomeData
- type KeyEvent
Constants ¶
This section is empty.
Variables ¶
var ( //BuildTime holds binary build time information BuildTime string //VersionAPI holds binary version information VersionAPI string //CommitSHA holds last commit hash information CommitSHA string //GoVersion holds Golang version information GoVersion string )
Functions ¶
This section is empty.
Types ¶
type Docs ¶
type Docs struct {
// contains filtered or unexported fields
}
Docs is a handler struct used to handle documentation calls
func NewDocs ¶
NewDocs is a factory method to create Docs service handler with defined Swagger YAML file path
func (*Docs) GetDocumentation ¶
func (docs *Docs) GetDocumentation(response http.ResponseWriter, request *http.Request)
GetDocumentation is used to serve doc handle
swagger:route GET /docs utilities getDocumentation Returns a HTML and JS page with this documentation<br> NOTE: This page was auto-generated by ReDoc (https://github.com/Redocly/redoc) responses:
200: responseDocumentation
func (*Docs) GetSwagger ¶
func (docs *Docs) GetSwagger(response http.ResponseWriter, request *http.Request)
GetSwagger is used to retrieve Swagger YAML file
swagger:route GET /resources/swagger.yaml utilities getSwagger Returns swagger.yaml configuration file needed for generating this documentation<br> NOTE: This file should be located in resources directory responses:
200: responseSwagger 404: errorSwagger
type Events ¶
type Events struct {
// contains filtered or unexported fields
}
Events is a service handler responsible for getting and updating events
func NewEvents ¶
func NewEvents(logger *log.Logger, validator *utils.Validator, database dataservice.Database) *Events
NewEvents is a factory method to create Events service handler with defined logger
func (*Events) AddEvent ¶
func (events *Events) AddEvent(response http.ResponseWriter, request *http.Request)
AddEvent is used to add new event and store it in DB
swagger:route POST /events events addEvent Creates a new event and adds it to DB responses:
200: responsePostEvent 400: errorBadQuery 422: errorValidation 500: errorInternal
func (*Events) DeleteEvent ¶
func (events *Events) DeleteEvent(response http.ResponseWriter, request *http.Request)
DeleteEvent is used to delete event with specified ID stored in DB
swagger:route DELETE /events/{id} events deleteEvent Deletes an event from DB by specified ID parameter responses:
204: responseNoContent 400: errorBadQuery
func (*Events) GetEvent ¶
func (events *Events) GetEvent(response http.ResponseWriter, request *http.Request)
GetEvent is used to retrieve stored events with specified ID
swagger:route GET /event/{id} events getEvent Returns a event with provided id responses:
200: responseGetEvent 404: errorNotFound 500: errorInternal
func (*Events) GetEvents ¶
func (events *Events) GetEvents(response http.ResponseWriter, request *http.Request)
GetEvents is used to retrieve currently stored events
swagger:route GET /events events getEvents Returns a list of currently stored events (all if no query params is used or filtered otherwise) responses:
200: responseGetEvents 400: errorBadQuery 500: errorInternal
func (*Events) UpdateEvent ¶
func (events *Events) UpdateEvent(response http.ResponseWriter, request *http.Request)
UpdateEvent is used to update event with specified ID stored in DB
swagger:route PUT /events/{id} events updateEvent Updates an event in DB by specified ID parameter responses:
200: responsePutEvent 400: errorBadQuery 422: errorValidation 500: errorInternal
type Home ¶
type Home struct {
// contains filtered or unexported fields
}
Home is a service handler used after visiting main service URL