You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by as...@apache.org on 2018/01/23 16:39:04 UTC

[incubator-servicecomb-service-center] branch master updated: SCB-295 Add plug-in mechanism doc (#259)

This is an automated email from the ASF dual-hosted git repository.

asifdxtreme pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-service-center.git


The following commit(s) were added to refs/heads/master by this push:
     new f73f6b8  SCB-295 Add plug-in mechanism doc (#259)
f73f6b8 is described below

commit f73f6b8195b7ad471034e9ed962844c8dc7fba5d
Author: little-cui <su...@qq.com>
AuthorDate: Wed Jan 24 00:39:01 2018 +0800

    SCB-295 Add plug-in mechanism doc (#259)
---
 server/plugin/README.md | 50 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/server/plugin/README.md b/server/plugin/README.md
new file mode 100644
index 0000000..89ff610
--- /dev/null
+++ b/server/plugin/README.md
@@ -0,0 +1,50 @@
+# Plug-in mechanism
+## Required
+1. Go version 1.8(+)
+1. Compile service-center with GO_EXTLINK_ENABLED=1 and CGO_ENABLED=1
+1. The plugin file name must has suffix '_plugin.so'
+
+## Plug-in names
+1. auth, Customize authentication of service-center.
+1. uuid, Customize micro-service/instance id format.
+1. auditlog, Customize audit log for any change done to the service-center.
+1. cipher, Customize encryption and decryption of TLS certificate private key password.
+1. quota, Customize quota for instance registry.
+
+## Example: an authentication plug-in
+
+### Step 1: code auth.go
+
+```go
+package main
+
+import (
+    "fmt"
+    "net/http"
+)
+
+func Identify(*http.Request) error {
+	// do something
+	return nil
+}
+```
+
+### Step 2: compile auth.go
+
+```bash
+GOPATH=$(pwd) go build -o auth_plugin.so -buildmode=plugin auth.go
+```
+
+### Step 3: move the plug-in in plugins directory
+
+```bash
+mkdir ${service-center}/plugins
+mv auth_plugin.so ${service-center}/plugins
+```
+
+### Step 4: run service-center
+
+```bash
+cd ${service-center}
+./servicecenter
+```
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
asifdxtreme@apache.org.