application

package
v2.0.0-...-7c0dadf Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

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