service

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

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 New

func New(cfg *config.Config) (*GatewayService, error)

New creates new gateway config

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

Jump to

Keyboard shortcuts

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