Multiple entries

How to start multiple GoFrame server with different port in one process?

Overview

With bootstrapper, user can start multiple GfEntry at the same time. Event for multiple different entries like GRPC.

Quick start

  • Install
go get github.com/rookie-ninja/rk-boot
go get github.com/rookie-ninja/rk-gf
gf:
  - name: alice
    port: 8080
    enabled: true
    commonService:
      enabled: true
  - name: bob
    port: 8081
    enabled: true
    commonService:
      enabled: true

1.Access entries

package main

import (
	"context"
	"github.com/rookie-ninja/rk-boot"
	"github.com/rookie-ninja/rk-gf/boot"
)

// Application entrance.
func main() {
	// Create a new boot instance.
	boot := rkboot.NewBoot()

    // Get alice
	boot.GetEntry("alice").(*rkgf.GfEntry)
    // Get bob
    boot.GetEntry("bob").(*rkgf.GfEntry)

	// Bootstrap
	boot.Bootstrap(context.Background())

	// Wait for shutdown sig
	boot.WaitForShutdownSig(context.Background())
}

Cheers

Last modified December 12, 2021 : Update based on rk-boot@v1.4.0 (233e143)