Plug-in mechanism


  1. Go version 1.8(+)
  2. Compile service-center with GO_EXTLINK_ENABLED=1 and CGO_ENABLED=1
  3. The plugin file name must has suffix ‘’
  4. All plugin interface files are in plugin package

Plug-in names

  1. auth: Customize authentication of service-center.
  2. uuid: Customize micro-service/instance id format.
  3. auditlog: Customize audit log for any change done to the service-center.
  4. cipher: Customize encryption and decryption of TLS certificate private key password.
  5. quota: Customize quota for instance registry.
  6. tracing: Customize tracing data reporter.
  7. tls: Customize loading the tls certificates in server

Example: an authentication plug-in

Step 1: code auth.go

auth.go is the implement from auth interface

package main

import (

func Identify(*http.Request) error {
	// do something
	return nil

Step 2: compile auth.go

GOPATH=$(pwd) go build -o -buildmode=plugin auth.go

Step 3: move the plug-in in plugins directory

mkdir ${service-center}/plugins
mv ${service-center}/plugins

Step 4: run service-center

cd ${service-center}