Multiple entries

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

Overview

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

Quick start

gin:
  - 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-gin/interceptor/context"
)

// Application entrance.
func main() {
	// Create a new boot instance.
	boot := rkboot.NewBoot()
    
    // Get alice
	boot.GetGinEntry("alice")
    // Get bob
	boot.GetGinEntry("bob")

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

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

Cheers

Last modified September 24, 2021 : Update based on rk-boot:v1.2.4 (357cf4c)