Documentation
¶
Index ¶
- type AppCore
- func (app *AppCore[T]) AddRoute(path string, method MethodType, handler RequestHandlerFunction[T])
- func (app *AppCore[T]) ConfigureDatabase(dbName string, mongoURI string)
- func (app *AppCore[T]) ConfigureRouter()
- func (app *AppCore[T]) Delete(path string, f func(w http.ResponseWriter, r *http.Request))
- func (app *AppCore[T]) Get(path string, f func(w http.ResponseWriter, r *http.Request))
- func (app *AppCore[T]) Post(path string, f func(w http.ResponseWriter, r *http.Request))
- func (app *AppCore[T]) Put(path string, f func(w http.ResponseWriter, r *http.Request))
- func (app *AppCore[T]) Run(host string)
- type DatabaseType
- type MethodType
- type MongoConfig
- type RequestHandlerFunction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppCore ¶
func (*AppCore[T]) AddRoute ¶
func (app *AppCore[T]) AddRoute(path string, method MethodType, handler RequestHandlerFunction[T])
func (*AppCore[T]) ConfigureDatabase ¶
func (*AppCore[T]) ConfigureRouter ¶
func (app *AppCore[T]) ConfigureRouter()
type DatabaseType ¶
type DatabaseType string
const ( MongoDB DatabaseType = "MongoDB" SqlServer DatabaseType = "SqlServer" )
type MethodType ¶
type MethodType int
const ( GET MethodType = 1 POST MethodType = 2 PUT MethodType = 3 DELETE MethodType = 4 )
type MongoConfig ¶
func (*MongoConfig) Configure ¶
func (db *MongoConfig) Configure(dbName string, mongoURI string) *MongoConfig
func (*MongoConfig) Connect ¶
func (db *MongoConfig) Connect() *mongo.Database
type RequestHandlerFunction ¶
type RequestHandlerFunction[T dbtype] func(database T, w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.