Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GatewayService ¶
type GatewayService struct { // Config is the configuration for teh gateway Config *config.Gateway // Server is the default gateway service server Server *http.Server I18n *i18n.Support // contains filtered or unexported fields }
GatewayService is the API gateway service structure
func Default ¶
func Default(routerName string) *GatewayService
Default creates the default gateway service for the provided router name
func NewWithC ¶
func NewWithC(c *controller.Controller, cfg *config.Gateway) (*GatewayService, error)
NewWithC creates new GatewayService with the provided Controller and the GatewayConfig
func (*GatewayService) Controller ¶
func (g *GatewayService) Controller() *controller.Controller
Controller returns the gateway controller
func (*GatewayService) RegisterModels ¶
func (g *GatewayService) RegisterModels(models ...interface{}) error
RegisterModels registers the model within the provided gateway's controller
func (*GatewayService) Run ¶
func (g *GatewayService) Run(ctx context.Context)
Run starts the GatewayService service and starts listening and serving If the Interrupt signal comes from the operating system
func (*GatewayService) SetHandlerAndRoutes ¶
func (g *GatewayService) SetHandlerAndRoutes() (err error)
SetHandlerAndRoutes sets the routes for the gateway service This step should be done as the last step before running the service It is based on the registered models and repositories