Documentation
¶
Overview ¶
Alias public types and functions for the package gimbap.
Index ¶
- func GetProvider[T interface{}](a GimbapApp, prov T) (ret T)
- type AppOption
- type Controller
- type ControllerOption
- type GimbapApp
- type IController
- type IMicroService
- type IServerEngine
- type MicroServiceProvider
- type MicroServiceProviderOption
- type Module
- type ModuleOption
- type Provider
- type ProviderOption
- type RouteSpec
- type RuntimeOptions
- type ServerEngineOption
- type TLSOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetProvider ¶
func GetProvider[T interface{}](a GimbapApp, prov T) (ret T)
Function to get a provider from the app.
Provide the app and the provider type to get the provider instance. If the provider is not found, it will panic.
Types ¶
type AppOption ¶
AppOption
This is the option provided when creating a Gimbap App ¶
Original type:
type AppOption struct {
AppName string
AppModule *module.Module
ServerEngine engine.IServerEngine
DepManager dependency.IDependencyManager
}
type Controller ¶ added in v0.0.4
type Controller = controller.Controller
Original type:
type Controller struct {
name string
instance IController
module *Module
}
func DefineController ¶
func DefineController(option ControllerOption) *Controller
Define a controller.
Defines a special provider that is used to handle RESTful requests. The controller will be registered to the app and can be injected to the other controllers.
type ControllerOption ¶
type ControllerOption = controller.ControllerOption
Original type:
type ControllerOption struct {
Name string
Instance IController
Module *Module
}
type GimbapApp ¶
Original type:
type GimbapApp struct {
appName string
appModule *module.Module
serverEngine engine.IServerEngine
depManager dependency.IDependencyManager
}
type IController ¶
type IController = controller.IController
Controller related Original type:
type IController interface {
RegisterRoutes(router *gin.Engine)
}
type IMicroService ¶
type IMicroService = microservice.IMicroService
Microservice related Original type:
type IMicroService interface {
Start() error
Stop() error
}
type IServerEngine ¶
type IServerEngine = engine.IServerEngine
Engine related Original type:
type IServerEngine interface {
Start(port int, tls *TLSOption) error
Stop() error
}
type MicroServiceProvider ¶ added in v0.0.5
type MicroServiceProvider = microservice.MicroServiceProvider
Original type:
type MicroServiceProvider struct {
name string
instance IMicroService
module *Module
}
func DefineMicroService ¶ added in v0.0.5
func DefineMicroService(option MicroServiceProviderOption) *MicroServiceProvider
Define a microservice
Define a special provider for microservices
type MicroServiceProviderOption ¶ added in v0.0.5
type MicroServiceProviderOption = microservice.MicroServiceProviderOption
Original type:
type MicroServiceProviderOption struct {
Name string
Instance IMicroService
Module *Module
}
type Module ¶
Original type:
type Module struct {
name string
providers []*Provider
dependsOn []*Module
}
func DefineModule ¶
func DefineModule(option ModuleOption) *Module
Define a module.
This defines a module with the given option. The module is used to determine the dependencies of the providers.
type ModuleOption ¶
type ModuleOption = module.ModuleOption
Module related Original type:
type ModuleOption struct {
Name string
Providers []*Provider
DependsOn []*Module
}
type Provider ¶ added in v0.0.4
Provider related Original type:
type Provider struct {
name string
instance interface{}
module *Module
}
func DefineProvider ¶
func DefineProvider(option ProviderOption) *Provider
Define a provider.
This defines a provider with the given option. The provider will be registered to the app and can be injected to the controllers.
type ProviderOption ¶
type ProviderOption = provider.ProviderOption
Original type:
type ProviderOption struct {
Name string
Instance interface{}
Module *Module
}
type RouteSpec ¶
type RouteSpec = controller.RouteSpec
Original type:
type RouteSpec struct {
Method string
Path string
Handler gin.HandlerFunc
}
type RuntimeOptions ¶
type RuntimeOptions = app.RuntimeOptions
Original type:
type RuntimeOptions struct {
Port int
TLS *TLSOption
}
type ServerEngineOption ¶
type ServerEngineOption = engine.ServerEngineOption
Original type:
type ServerEngineOption struct {
EngineType string
}
Directories
¶
| Path | Synopsis |
|---|---|
|
Experimental Gimbap Dependency Manager
|
Experimental Gimbap Dependency Manager |
|
File: http-engine.go
|
File: http-engine.go |
|
File: module.go
|
File: module.go |
|
file: provider.go
|
file: provider.go |