Documentation ¶
Index ¶
- func WriteJSONArrayResponse(w http.ResponseWriter, event []*model.Event, status int)
- func WriteJSONErrorResponse(w http.ResponseWriter, message string, status int)
- func WriteJSONResponse(w http.ResponseWriter, event *model.Event, status int)
- type ConfigParameters
- type GoService
- func (goservice *GoService) GetAll(w http.ResponseWriter, r *http.Request)
- func (goservice *GoService) GetByID(w http.ResponseWriter, r *http.Request)
- func (goservice *GoService) Initialize()
- func (goservice *GoService) PostCreate(w http.ResponseWriter, r *http.Request)
- func (goservice *GoService) Run()
- func (goservice *GoService) WaitForShutdown()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteJSONArrayResponse ¶
func WriteJSONArrayResponse(w http.ResponseWriter, event []*model.Event, status int)
WriteJSONArrayResponse with content type and status code
func WriteJSONErrorResponse ¶
func WriteJSONErrorResponse(w http.ResponseWriter, message string, status int)
WriteJSONErrorResponse with content type and status code
func WriteJSONResponse ¶
func WriteJSONResponse(w http.ResponseWriter, event *model.Event, status int)
WriteJSONResponse with content type and status code
Types ¶
type ConfigParameters ¶
type ConfigParameters struct { CloudConfig string DbName string DbUser string DbPass string DbType string DbHost string DbPort string Realm string RealmUser string RealmSecret string HTTPPort string }
ConfigParameters for App
type GoService ¶
type GoService struct { Router *mux.Router DB *gorm.DB Server *http.Server Config *ConfigParameters }
GoService containing router and database
func (*GoService) GetAll ¶
func (goservice *GoService) GetAll(w http.ResponseWriter, r *http.Request)
GetAll GET method
func (*GoService) GetByID ¶
func (goservice *GoService) GetByID(w http.ResponseWriter, r *http.Request)
GetByID GET method
func (*GoService) Initialize ¶
func (goservice *GoService) Initialize()
Initialize app router and configuration
func (*GoService) PostCreate ¶
func (goservice *GoService) PostCreate(w http.ResponseWriter, r *http.Request)
PostCreate POST method
func (*GoService) Run ¶
func (goservice *GoService) Run()
Run app and initialize db connection and http server
func (*GoService) WaitForShutdown ¶
func (goservice *GoService) WaitForShutdown()
WaitForShutdown application server
Click to show internal directories.
Click to hide internal directories.